MediaMonkey does not follow the defacto .csv standard for embedded quotes (see http://creativyst.com/Doc/Articles/CSV/CSV01.htm).
This malformed csv creates formatting issues when importing to other applications.
For example, in the following export line, Five by February is in my database as "Five by February", and is exported in the .csv report as ""Five by February", but should be exported as """Five by February"""
export line from .csv:
"","Let's Get it Started",""Five by February"","3:41",0,"",-1,128,"G:\music\_Five by February_\01 Let's Get it Started.m4a","[re]drive"
malformed CSV in reports when " exist in a field [#6457]
Moderator: Gurus
Re: malformed CSV in reports when quotes exist in a field
Try changing QAStr = chr(34) & SDB.toASCII(astr) & chr(34) on line 19 of C:\Program Files\MediaMonkey\Scripts\Export.vbs to QAStr = chr(34) & chr(34) & SDB.toASCII(astr) & chr(34) & chr(34), if I'm not mistaken looking at it quickly it would do the trick.
Download MediaMonkey ♪ License ♪ Knowledge Base ♪ MediaMonkey for Windows 2024 Help ♪ MediaMonkey for Android Help
Lowlander (MediaMonkey user since 2003)
Lowlander (MediaMonkey user since 2003)
Re: malformed CSV in reports when quotes exist in a field
Hi Lowlander, and thank you,
But while that would work for my example above, it won't work for all cases - for example, this title:
Cantate "Cessate, Omai Cessate", RV. 684. II Larghetto e Andante molto. Ah ch'i
is includedin the csv report as follows:
"Antonio Vivaldi","Cantate "Cessate, Omai Cessate", RV. 684. II Larghetto e Andante molto. Ah ch'i","Stabat Mater","5:16",...
which creates problems because it re-parses to:
Antonio Vivaldi | Cantate "Cessate | Omai Cessate", RV. 684. II Larghetto e Andante molto. Ah ch'i | Stabat Mater | 5:16
not to mention that it breaks the csv import to google fusion tables (just uploaded my whole db there) since it's malformed.
But I see the solution, it looks like the export.vbs needs to be expanded to look for embedded quotes, and then needs to properly handle them as per the csv "standards" I referenced above. Too bad my visual basic is sooo rusty... But since the commas are already in quoted fields, it's just the case for double-qotes.
so this line:
"Antonio Vivaldi","Cantate "Cessate, Omai Cessate", RV. 684. II Larghetto e Andante molto. Ah ch'i","Stabat Mater","5:16",...
would become:
"Antonio Vivaldi","Cantate ""Cessate, Omai Cessate"", RV. 684. II Larghetto e Andante molto. Ah ch'i"","Stabat Mater","5:16",...
But while that would work for my example above, it won't work for all cases - for example, this title:
Cantate "Cessate, Omai Cessate", RV. 684. II Larghetto e Andante molto. Ah ch'i
is includedin the csv report as follows:
"Antonio Vivaldi","Cantate "Cessate, Omai Cessate", RV. 684. II Larghetto e Andante molto. Ah ch'i","Stabat Mater","5:16",...
which creates problems because it re-parses to:
Antonio Vivaldi | Cantate "Cessate | Omai Cessate", RV. 684. II Larghetto e Andante molto. Ah ch'i | Stabat Mater | 5:16
not to mention that it breaks the csv import to google fusion tables (just uploaded my whole db there) since it's malformed.
But I see the solution, it looks like the export.vbs needs to be expanded to look for embedded quotes, and then needs to properly handle them as per the csv "standards" I referenced above. Too bad my visual basic is sooo rusty... But since the commas are already in quoted fields, it's just the case for double-qotes.
so this line:
"Antonio Vivaldi","Cantate "Cessate, Omai Cessate", RV. 684. II Larghetto e Andante molto. Ah ch'i","Stabat Mater","5:16",...
would become:
"Antonio Vivaldi","Cantate ""Cessate, Omai Cessate"", RV. 684. II Larghetto e Andante molto. Ah ch'i"","Stabat Mater","5:16",...
Re: malformed CSV in reports when quotes exist in a field
Try the following then for the same code:
QAStr = chr(34) & SDB.toASCII(Replace(astr,"""","""""")) & chr(34)
Again I haven't tested it.
QAStr = chr(34) & SDB.toASCII(Replace(astr,"""","""""")) & chr(34)
Again I haven't tested it.
Download MediaMonkey ♪ License ♪ Knowledge Base ♪ MediaMonkey for Windows 2024 Help ♪ MediaMonkey for Android Help
Lowlander (MediaMonkey user since 2003)
Lowlander (MediaMonkey user since 2003)
Re: malformed CSV in reports when quotes exist in a field
Download MediaMonkey ♪ License ♪ Knowledge Base ♪ MediaMonkey for Windows 2024 Help ♪ MediaMonkey for Android Help
Lowlander (MediaMonkey user since 2003)
Lowlander (MediaMonkey user since 2003)