Tag Editing

For MP3 Tags use mid3v2

sudo apt install python-mutagen

Clear the existing takes

mid3v2 --delete-all *

Set the common elements; author, book title, genre, year, series and order

mid3v2 --artist="Glen Cook" --album="Water Sleeps" --genre="Fantasy" --year="1999" --TIT1="The Black Company" --TSOA="01"

Set the song and track numbers, assuming the files 'ls' in order

X=`ls *.mp3|wc -l`;Y=1; for Z in *.mp3;do mid3v2 --song="Chapter `printf "%02d\n" $Y`" --track="$Y/$X" "$Z";((Y++));done

You may want to rename the files while you're at it. If you have more than 99 files, adjust the %02 to %03 for three 0 justification

X=`ls *.mp3|wc -l`;Y=1; for Z in *.mp3;do echo mv "$Z" "Glen Cook - The Black Company - Water Sleeps - `printf "%02d\n" $Y`.mp3";((Y++));done

# For video
X=1;for Y in *.mkv;do mv "$Y" "The Outer Limits - S03E`printf "%02d\n" $X`.mkv";((X++));done


   The 'Album sort order
author in the COMPOSER tag, and narrator in the ARTIST tag

For m4v tags, install the mp4 utilities

#If on deb, check out http://www.deb-multimedia.org/ to install

sudo apt install mp4v2-utils

mp4tags -artist="Glen Cook" -album="Water Sleeps" -grouping "The Dark Company" *

# Check this varient out
for b in *.m4b; do
  [ "$n" ] && n=$((10#$n + 1))
  [ -z "$n" ] && n=1
  mp4tags -album "An Good Audiobook"… -disk $(printf "%02u" $n)… "$b"


# here's an example of pulling info from the filename

for X in `ls *.mp3`;do Y=`echo $X | sed 's/Track\(..\)\.mp3/\1/'`;Z=`printf "%02d\n" $((10#$Y + 1 ))`;echo mid3v2 --track="$Y/72" $X;done



Batch with Mp3tag

You can use this program to import a CSV file of tags. 

    Convert -> Text file - tag

It will want two things: A file and a Format String.  The file will have the tags, and the format string you will construct.


Compile your Spreadsheet, using the column names at the top. These column names will become the names of your tags.
Ensure you have one line for every mp3.
Export to a CSV, and exit the Spreadsheet program
Open the CSV in wordpad. 
Cut out the header row,  and paste it into a new wordpad, saving it for later
Take a look at the data in the columns. Make note of any that have quotes surrounding them (this happens when the contents have a comma in them)
Note this in the other wordpad that has your header row

Format String

In the wordpad that has your header row, you want to change it from ALBUM,ARTIST to %ALBUM%,%ARTIST%. You can do this with find and replace somewhat. Of the columns that had quotes, simply insert them;  %ALBUM%,"%ARTIST%" 

Sample CSV File

NPR: Car Talk Podcast,NPR,Stories: ,0,2010,Podcast,1,"Teresa in Yakima, WA"

Sample Header