Skip to content

Instantly share code, notes, and snippets.

@adamvr
Created August 24, 2012 10:43
Show Gist options
  • Select an option

  • Save adamvr/3449000 to your computer and use it in GitHub Desktop.

Select an option

Save adamvr/3449000 to your computer and use it in GitHub Desktop.
Loading id3v2 into an mp3 based on a tracks file

Possibly better served by an awk script and a more detailed tracks file, but it's a nice quick and dirty solution.

Also scraping the tracks file from wikipedia or elsewhere would be cool too.

1;Sultans Of Swing;Private Investigations: The Best of Dire Straits and Mark Knopfler;Mark Knopfler;20;2005
cat tracks | while read line
do
num=`echo $line | cut -d';' -f1`
track=`echo $line | cut -d';' -f2`
artist=`echo $line | cut -d';' -f4`
album=`echo $line | cut -d';' -f3`
genre=`echo $line | cut -d';' -f5`
year=`echo $line | cut -d';' -f6`
id3v2 -T "$num" -t "$track" -a "$artist" -A "$album" -g "$genre" -y "$year" "${track}.mp3"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment