Create a gist now

Instantly share code, notes, and snippets.

Script and data to update mp3 files with metadata. Assumes mp3 files in "tracks" subfolder.
#!/bin/bash
author="Palacios Area Historical Association";
album="Palacios Historic Homes Tour";
subtitle="City by the Sea Museum, Palacios, Texas";
total="51";
# loop over two coloum csv of track numbers and titles
while IFS="," read i t
do
if [ -n "$i" ] # skip blank lines
then
echo "[Info] Setting tags for $i - $t";
j=`printf %02d $i`; # track numbers as two digits with leading zeros
mid3v2 -a "$author" -A "$album" --TIT3 "$subtitle" -g "12" -t "Track $j - $t" "tracks/$j Track $i.mp3"
fi
done < tracks.csv
1 Introduction
2 401 Commerce
3 Directions to Moonlight Bay
4 Moonlight Bay
5 Directions to Luther
6 408 South Bay
7 Directions to 308 South Bay
8 308 South Bay
9 Directions to 118 South Bay
10 118 South Bay
11 Directions to 11 1st
12 11 1st
13 101 1st
14 Directions to 214 Duson
15 214 Duson
16 Directions to 108 Commerce
17 108 Commerce
18 Directions to 203 East Bay
19 203 East Bay
20 Directions to 317 East Bay
21 317 East Bay
22 Directions to 1411 East Bayshore
23 Music to 1411 East Bayshore
24 Directions to 1411 East Bayshore
25 1411 East Bayshore
26 Directions to 1505 East Bayshore
27 1505 East Bayshore
28 Directions to 2203 East Bayshore
29 Music to 2203 East Bayshore
30 Directions to 2203 East Bayshore
31 2203 East Bayshore
32 Directions to 907 8th
33 Music to 907 8th
34 Directions to 907 8th
35 907 8th
36 Directions to 601 4th
37 601 4th
38 Directions to 410 4th
39 410 4th
40 Directions to 316 Welch
41 316 Welch
42 309 Weich
43 308 Welch
44 Directions to 100 Welch
45 100 Welch
46 Directions to 208 Main
47 208 Main
48 Gertie's Song
49 300 3rd
50 Directions back to Museum
51 End thank you
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment