Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support CSV files #340

Open
alexec opened this issue Mar 26, 2020 · 3 comments
Open

Support CSV files #340

alexec opened this issue Mar 26, 2020 · 3 comments
Labels
kind/enhancement New feature or request topic/std Relates to the standard library

Comments

@alexec
Copy link

alexec commented Mar 26, 2020

Can we read CSV files please?

@dlespiau
Copy link
Member

We do not provide specific support for CSV files at the moment, unfortunately. It's always possible to read a file as a string though, iterate over the lines and parse the fields in javascript.

I guess it could be somewhat possible to provide some built-in support, eg. transform a CSV file that looks like:

name,count
damien,2
michael,2

into something like

[{
    "name": "damien"
    "count": 2,
},{
    "name": "michael",
    "count": 2,
}]

but there's a lot of metadata to provide for this to work: column names, column types, field separator, ...

I'd lean towards writing that logic in js instead of providing built-in support /me thinks.

@dlespiau dlespiau changed the title Do you support CSV files? Support CSV files Mar 27, 2020
@alexec
Copy link
Author

alexec commented Mar 27, 2020

I think there are probably good NPM libraries for CSV parsing. We have data we need to build out app from, being able to use CSV would mean we could only use JK.

@squaremo
Copy link
Member

CSV (tab-SV, etc.) can be more complicated than it seems, with quoting and so on. It may be worth building this in (go has encoding/csv), perhaps as an RPC if not a std.Format.

@squaremo squaremo added kind/enhancement New feature or request topic/std Relates to the standard library labels Mar 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request topic/std Relates to the standard library
Projects
None yet
Development

No branches or pull requests

3 participants