
July 25th, 2004, 05:19 PM
|
|
Registered User
|
|
Join Date: Jul 2004
Posts: 3
Time spent in forums: < 1 sec
Reputation Power: 0
|
|
Howto rename files according to lines from another file
How can I rename bladeenc ripped mp3 files according to the songnames I get from cddb server.
When I rip files with Baldeenc, it cretes them as "track01.cdda.mp3". With commands like: "cd-info | grep "artist" | awk -F"'" '{ print $2 }'" I can create a flat file with format "artistname-songname" per line and I want to use these lines to rename files created by bladeenc. So to say, if line 1 is: "Linkin Park - Papercut", the file track01.cdda.mp3 will be renamed as "Linkin Park - Papercut.mp3" and so on. I tried sth like: "mv $f `echo $f | tr '[track01.mp3]' '["sed -ne '1 p' titles".mp3]'`" but mv doesn't recognise a filename there and then sth like: "for _file in track01.cdda.mp3; do _new_file=$(echo "$_file" | sed -ne '1 p' titles); mv "$_file" "$_new_file" but didn't work, too. Prompted: Illegal variable name.
I prefer a way with either sed, awk or tcsh since I want to learn these and am using them.
Thanks in advance.
|