Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Shell Scripts' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Shell Scripts
Authored by: Shiver758 on Aug 06, '03 07:40:50PM
Ok.. This is a particularly tangly example, and written on the fly. Therefore it hasn't been "optimized" or anything like that. Please cat flames on my bash scripting ability to /dev/null.

for i in *.mp3
do
album="The Thorns"
artist="The Thorns"
tnum=`echo $i |awk '{print $1}'`
fname=`echo $i |awk -F\( '{print $1}' |awk -F\- '{print $2}' |cut -c 2-|sed s/.$//g`
id3tool -c$tnum -t "$fname" -a "$album" -r "$artist" -y 2003 "$i"
done

This one was made to take apart a list of filenames with the number of the track, and the name (example "01 - Runaway Feeling (The Thorns.The Thorns.2003).mp3"). I knew the artist name, the album, and the year, so I just hardcoded them. enjoy!

[ Reply to This | # ]