data-forge / data-forge-ts

The JavaScript data transformation and analysis toolkit inspired by Pandas and LINQ.
http://www.data-forge-js.com/
MIT License
1.33k stars 77 forks source link

Add support for TSV #120

Closed moltar closed 3 years ago

moltar commented 3 years ago

I have a use case for working with TSV (tab separated values) files.

I think maybe a general solution would be to have a provider pattern that can then be pluggable and be able to deal with any source of data.

Maybe v2?

ashleydavis commented 3 years ago

Hi @moltar thanks for your feedback!

Pluggable data sources are definitely intended for v2, but this wouldn't have to wait for that!

I think Papa Parse (which DF uses for CSV) also supports TSV. So it's possibly just a matter of turning it on.

All options for parsing are passed through to Papa Parse already, you might just to set the delimiter to the tab character.

Here are the Papa Parse options:

https://www.papaparse.com/docs#config

Please let me know if this makes it work for you.

moltar commented 3 years ago

Oh, yeah, great. Thanks. That will probably work!