farling42 / obsidian-import-json

Plug-in for Obsidian.md which will create Notes from JSON files
MIT License
91 stars 5 forks source link

Please support TSV files as well #4

Closed ckennedy666 closed 2 years ago

ckennedy666 commented 2 years ago

Is it possible to support Tab Separated Values (TSV)? This would be a great help in my attempt to import Traveller RPG sector data from TravellerMap.com in the https://travellermap.com/doc/fileformats#t5-tab-delimited-format.

Thanks.

farling42 commented 2 years ago

That is probably possible. I think the library I'm using for reading CSV permits any arbitrary separator. Regards,Martin

On 19 Feb 2022 15:10, ckennedy666 @.***> wrote: Is it possible to support Tab Separated Values (TSV)? This would be a great help in my attempt to import Traveller RPG sector data from TravellerMap.com in the https://travellermap.com/doc/fileformats#t5-tab-delimited-format. Thanks.

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you are subscribed to this thread.Message ID: @.***>

farling42 commented 2 years ago

Although I see that TSV has some extra rules, so might not parse properly if your days has blank lines, or other escape characters that CSV allows.

ckennedy666 commented 2 years ago

Biggest issue with my dataset is the use of { } within the data. But it is only a single curly brace when used, so hopefully it won't conflict with Handlebars.

farling42 commented 2 years ago

Having checked the functionality within the PapaParse library I'm using to read CSV files, it will auto detect the delimiter from any of comma, tab, pipe, semi-colon, ASCII record separator(30), ASCII unit separator (31).

farling42 commented 2 years ago

You will need to change the file types in the JSON/CSV file selector dialog to show all files in order to select your TSV file, but otherwise the importer should auto-detect it just fine.

Can you test and let me know if it reads your files?

ckennedy666 commented 2 years ago

Just tested. I had to name the file .csv even though it was a TSV file. It worked! My very basic test looks good. It would be nice if the file name filter allowed .tsv as well as .csv.

Thanks.

ckennedy666 commented 2 years ago

Only thing I see (with 0.8.0), the name of the file must end with .csv for the import to be successful, but it will process TSV file without issue.

Thanks.

farling42 commented 2 years ago

.tsv file extension will be supported in 0.11.0