Xubus
July 26th, 2007, 10:34 AM
Okay, this is a rather vague question that may be obvious to some (hopefully very obvious :P)
I've searched for working with strings with bash but all the bash guides I've found are about writing scripts with dedicated files. I don't want to do that. I want to do it on the fly ;)
I want to take a set of similarly named files and rename them with another set of similar names.
An example: the output of cdda2wav would be lots of audio_01.wav. Currently I just do
flac --best *_[012][0123456789].* and rename them individually by hand. Ouch, eh.
What I'd want to do is say ... make name01-20 the names of the songs, then rename the files to
Artist.yyyy-mm-dd.Album.##.Track.flac. The only thing I realise at this point is I'm going to be using some kind of loop. Will I need sed? Sed scripts look awfully confusing ...
In repetition, I want to take
audio_[0-2][0-9].flac
and turn it into
Artist.2000-01-01.Album.[0-2][0-9].$name1-20.flac
Preferably with a one liner.
... I'm clueless! :confused: Can anyone show me how to do it please?
(I'm not sure whether this is worthy of being in the programming section ... mods feel free to move it to general if it's not)
Secondary question:
How would I monitor a folder and make a copy of each revision of every file in said folder each time they change and append the date onto said revisions (i.e. former_name+date.ext).
I've searched for working with strings with bash but all the bash guides I've found are about writing scripts with dedicated files. I don't want to do that. I want to do it on the fly ;)
I want to take a set of similarly named files and rename them with another set of similar names.
An example: the output of cdda2wav would be lots of audio_01.wav. Currently I just do
flac --best *_[012][0123456789].* and rename them individually by hand. Ouch, eh.
What I'd want to do is say ... make name01-20 the names of the songs, then rename the files to
Artist.yyyy-mm-dd.Album.##.Track.flac. The only thing I realise at this point is I'm going to be using some kind of loop. Will I need sed? Sed scripts look awfully confusing ...
In repetition, I want to take
audio_[0-2][0-9].flac
and turn it into
Artist.2000-01-01.Album.[0-2][0-9].$name1-20.flac
Preferably with a one liner.
... I'm clueless! :confused: Can anyone show me how to do it please?
(I'm not sure whether this is worthy of being in the programming section ... mods feel free to move it to general if it's not)
Secondary question:
How would I monitor a folder and make a copy of each revision of every file in said folder each time they change and append the date onto said revisions (i.e. former_name+date.ext).