CSV Delimiter Detection Fails

I’ll start by saying that I don’t use CSV imports generally. And I’m facing this issue on a file created by ChatGPT.

The issue is basically that the first line in the file contains a comma. According to the manual Anki should be able to correctly pre-select the delimiter in the import screen. (one of my PRs removed this line though so don’t bother searching). In my case, that’s not happening. Anki is selecting semicolon instead of comma.

I have a gut feeling it’s not a bug though. But it can be. There have been a lot of updates to CSV import code (mainly by llama).

Attaching the file too. Maybe chatGPT messed up.

See [Bug] File headers not working correctly with .csv files · Issue #3853 · ankitects/anki · GitHub for context on csv delimiter detection

tldr: it’s not a bug, but instead a feature request that wasn’t implemented nor will it likely be as it didn’t justify the added bloat. as csv delimiter detection is glorified guessing, the “bug” will still exist despite making the heuristic smarter

I haven’t seen the attached file, but i’m guessing it doesn’t have file headers. You can work around this by adding them

Did you remove it because it’s not correct information? Or do you now realize that you removed it in error – and you’re going to fix it?

This seems to be a common enough question to warrant adding a disclaimer to the manual

If you understand the correct expected behavior (and the current state of things, if that’s different), it would be great for you to update the manual. But the next-best idea would be if you could drop it in the issue tracker so someone else can fix it when they have time. Thanks!

I thought it was trivially helpful information but dae didn’t want me to remove it. The plan then was I would add this piece of info back in a later PR. I never got to reorganizing that section and putting that info back though because of my exams.

I guess this is a good lesson about being too eager to remove things from the manual. Are you taking care of it now?

I will first have @dae clarify if what he said to me previously in github is still true because @llama seems to be saying the opposite.

If no separator has been specified, the contents of the first field will control what Anki guesses it should be.

Opened a pr :+1:

2 Likes