I exported tags from a large group of flac and mp3 files to a csv using a custom mte spec. I first used $list() to export a listing of tags in these same files. When viewing the $list() output, I noticed that the different files had different tag sets. This is not surprising as the files were generated and tagged inconsistently over a few years (I am in process of cleaning up)
But what is surprising is that the csv of exported tags contains a varying number of columns across all the files. My mte file contains all fields which were found in at least one file (using $list() output). While I realize not all tags are in all files, I would expect the output to use blank/null columns for tags not found.
When I import the '|'-delimited csv into sqlite, it reports varying # of columns on different lines:
all_rev.csv:95: expected 62 columns but found 17 - filling the rest with NULL
all_rev.csv:96: expected 62 columns but found 46 - filling the rest with NULL
all_rev.csv:323: expected 62 columns but found 17 - filling the rest with NULL
all_rev.csv:324: expected 62 columns but found 1 - filling the rest with NULL
This is telling me that the first 94 lines have the expected 62 columns, but lines 95 and 96 has 17 and 46 respectively, and lines 323 and 324 has 17 and 1 column each. There are many more lines I have not shown here.
I looked at the csv and verified that the # of delimiters agrees with this output.
The generated csv does has many blank columns (as expected) on the lines that have the expected # of columns, for instance, this line has many blank columns:
4/14|-6.88 dB|1.109784|-8.04 dB|0.991878|Back Porch Music Vol 7|Balfa Toujours|Various Artists|Audiograbber 1.83.01, LAME dll 3.96, VBR 2 (Old method), Joint Stereo, Normal quality|Kingpin Special|||||||||||||||||||||||||||||||%TCOM%|||||||||||||||||||||
So the question is, why doesn't every line has the same number of columns, blank or not? Obviously, the csv lines with varying # of columns can't be processed since it is not possible to tell which columns were dropped and which were not.
I have pasted the mte I used to generate the csv at bottom of this message.
$loop(%_filename_ext%)%TRACK%|%replaygain_album_gain%|%replaygain_album_peak%|%replaygain_track_gain%|%replaygain_track_peak%|%ALBUM%|%ARTIST%|%ALBUMARTIST%|%ENCODERSETTINGS%|%TITLE%|%DISCNUMBER%|%COMMENT iTunPGAP%|%COMMENT iTunNORM%|%COMMENT iTunSMPB%|%COMMENT iTunes_CDDB_1%|%COMMENT iTunes_CDDB_TrackNumber%|%COMMENT%|%ENCODEDBY%|%GENRE%|%PUBLISHER%|%YEAR%|%ARTISTSORT%|%ALBUMARTISTSORT%|%ASIN%|%AccurateRipResult%|%AccurateRipDiscID%|%Label%|%Composer%|%Style%|%Catalog #%|%Source%|%Encoded By%|%Encoder%|%Encoder Settings%|%TRACKTOTAL%|%DISCTOTAL%|%Soloists%|%Compilation%|%ISRC%|%TCOM%|%%TCOM%%|%Conductor%|%BPM%|%COMMENT iTunes_CDDB_IDs%|%ORIGARTIST%|%COPYRIGHT%|%BANDSORTORDER%|%recording dates%|%UNSYNCEDLYRICS%|%RELEASETIME%|%COMMENT ID3 v1 Comment%|%WWWCOMMERCIALINFO%|%WWWCOPYRIGHT%|%WWWAUDIOFILE%|%WWWARTIST%|%WWWAUDIOSOURCE%|%WWWPUBLISHER%|%TAGGINGTIME%|%file_size%|%mod_date%|%path%|%filename_ext%