I’m having three issues with the Export function that make the process of Exporting / Modifying / Importing very prone to errors (a process needed for operations too complex for the Find/Replace function in the browser).
Cannot choose delimiter
Export forces the TAB delimiter. Not convenient, forces a search/replace. IMO all delimiters which are allowed in headers should also be allowed in export: Comma , Semicolon , Tab , Space , Pipe , Colon
See Text Files - Anki Manual
Export escapes double quotes, making it impossible to import again
For instance,
<img src="AFDOT-foundation.jpg">
becomes
"<img src=""AFDOT-foundation.jpg"">"
This leads to import errors
I really don’t see a reason to escape double quotes in particular…
This makes the re-import very prone to errors.
Deck and Notetype headers are missing
I appreciate that the exported file contains the following headers:
#separator:
#html:
#tags column:
However, tags and deck are missing, making re-import error-prone.
When the checkbox is checked, they are pre-prepended to each note, which is rather ugly, but no header is generated.
I recommend adding these two headers:
Since this is a suggestion, can you explain how this “forces a search/replace” for your use case? It sounds like there is some reason you can’t leave the delimiter as-is in your file, and knowing that reason will help the devs understand how a change would help.
The page of the manual you linked to explains why double quotes within a field need to be escaped. You don’t say what sort of import errors you’re getting. As long as your file manipulations don’t interfere with the relationship between double quotes and escaped double quotes, your file should import just fine.
Yes, you have to check those boxes to include that information in an export. But you don’t say what errors this is causing for you on re-import.
If your only concern is that using #deck column and #notetype column doesn’t look as good in your CSV file, I think it’s unlikely that will change. Using the column-type headers instead of overall file headers allows much more flexibility for users, and it’s obviously necessary when all of the exported notes are not of the same note type, or their cards are in different decks.
If you don’t need that flexibility and want the file to look different, it seems like you could reduce those to overall file headers for yourself with a few copy-pastes and deleting those columns.
Thank you for your reply and sharing your thoughts.
Regarding the tabs, I am forced to do a search-replace because tab-delimited files are hard to edit in most text editors. Tabs typically don’t appear with a consistent width, so it’s often hard to know whether a space is a space or a tab. I use EditPad Pro which will actually let me visualize tabs. Still, it’s visually less pleasing and harder to work with than working with semicolons.
At the end of the day, all I’m saying is that if Anki allows Semicolon and a few others in the headers, why not make it easy for users and also allow those while exporting.
Escaped double quotes create problems when I edit the file and add other segments with double quotes. To avoid these and other problems, at the moment, after exporting I let Python massage the file so I can work with it again.
For my present export situation I fail to see the point of exporting with escaped double quotes, as importing my regular file with unescaped double quotes works fine. But I’m sure that you’re right and it makes sense for certain cases that just aren’t in my files, such as an entire field within double quotes. So maybe I should try switching to single quotes within my files, especially for things such as href=" and src="
Regarding the #deck: and #notetype: headers, I read what you said.
But when exporting a single deck it would be such a simple thing to add, really the cost is zero, and it’s much cleaner than the columns.
As I said for my current task I switched to post-processing with Python, but the next time around it will be a problem again, and having to paste these column names just isn’t an elegant solution.