Bug: Text file import misses duplicates with trailing white space

I just updated to 2.1.60 (Mac intel) and imported a text file which has a large overlap with existing cards. I append to this text file when adding new cards so the majority of lines have already been imported exactly as is at an earlier time. With my previous version, the duplicates were correctly identified whereas they are not in version 2.1.60.

The issue seems to be trailing white space. The file looks like:

foo ; bar
foofoo ; barbar

Previous version trimmed the trailing white space upon import, creating new notes without it (as in “foo” as the first field), as well as compared duplicates on the trimmed strings. The new import function also creates new notes without the white space but compares duplicates including it.
The result on v2.1.60 is an import for which almost all notes are duplicated and with identical first fields (no white space in either old or new note).

I suspect this is not intentional but a bug.

(If it nevertheless is intentional for some corner cases where white space is important for some users, I would wish for an import checkbox to include/exclude white spaces).

It doesn’t - the spaces are included in the fields, but as HTML collapses whitespace by default, it won’t be visible unless you look at the HTML source of the field.

We’ll keep an eye on demand for a whitespace-collapsing feature, but you may want to consider fixing the files instead, as some programs like Excel do not offer options to trim whitespace either.

Thank you, dae!

I did not see any white space while inspecting the fields with the “Browse” window. Perhaps the representation there is trimmed too(?) while the underlying info still has it. Regardless, I understand that this is now expected behavior and that I’ll have to adapt all my files and generating scripts to it. Thanks for answering so quickly!

1 Like

No problem! If you did want to see the whitespace by the way, you can click the <> icon on a field to reveal the underlying HTML in the editor.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.