d2jsp
Log InRegister
d2jsp Forums > Off-Topic > Computers & IT > Programming & Development > Batch Rename Files
Add Reply New Topic New Poll
Member
Posts: 44,951
Joined: Oct 17 2007
Gold: 0.00
May 22 2017 02:37pm
Hi

I'll explain what i am trying to achieve, and hopefully someone can tell me whether there is an easy way or not.

I have a lot of music which is formatted as follows:

TRACKNUMBER - ARTISTNAME - SONGNAME

The problem that causes, is that it is all loaded on my usb and played on my media device on my car - but unfortunately there is no scroll on my media device.

As such, i end up seeing track number, artist name and the first few letters of the song name.

I wondered whether there is an easier way to manually rename all the files deleting the artist name so they are then formatted with just track number and song name.

Thanks in advance
Member
Posts: 3,197
Joined: May 4 2013
Gold: 1,457.00
May 22 2017 03:34pm
Sure it's reading filenames and not tags?

But basically:

Code
$ rename -n -v 's/(.*?)\s*\-.*\-\s*/$1 - /g' *.mp3
TRACKNUMBER - ARTISTNAME - SONGNAME.mp3 renamed as TRACKNUMBER - SONGNAME.mp3


remove -n switch when satisfied

I would rather suggest you to use beets (https://beets.io) to manage your music and rename and tag accordingly.

This post was edited by nuvo on May 22 2017 03:34pm
Member
Posts: 44,951
Joined: Oct 17 2007
Gold: 0.00
May 23 2017 12:39pm
Quote (nuvo @ May 22 2017 09:34pm)
Sure it's reading filenames and not tags?

But basically:

Code
$ rename -n -v 's/(.*?)\s*\-.*\-\s*/$1 - /g' *.mp3
TRACKNUMBER - ARTISTNAME - SONGNAME.mp3 renamed as TRACKNUMBER - SONGNAME.mp3


remove -n switch when satisfied

I would rather suggest you to use beets (https://beets.io) to manage your music and rename and tag accordingly.


it reads tags for artist name and album name only on my media screen, but for the track title, it reads the file name
Go Back To Programming & Development Topic List
Add Reply New Topic New Poll