Skip to content

Instantly share code, notes, and snippets.

@jhubble
Last active April 26, 2024 19:26
Show Gist options
  • Save jhubble/0a46b867c1160112965613da5055a97e to your computer and use it in GitHub Desktop.
Save jhubble/0a46b867c1160112965613da5055a97e to your computer and use it in GitHub Desktop.
Get statistics of music by year from iTunes (Mac Music) library
# First export the iTunes ( aka "Music") Library.xml
# Get a list of all years present
cat Library.xml|grep Year |grep integer |sed 's/[^0-9]*//g' |sort |uniq >allyears.txt
# get a list of years to compare against (change to appropiate start and end years)
seq 1500 2024 >from1500.txt
# now see which years are missing
comm -13 allyears.txt from1500.txt
# To see what are the most common years:
cat Library.xml|grep Year |grep integer |sed 's/[^0-9]*//g' |sort |uniq -c |sort -n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment