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

Using CSV data instead of JSON #261

Open
mspanish opened this issue Jul 10, 2020 · 1 comment
Open

Using CSV data instead of JSON #261

mspanish opened this issue Jul 10, 2020 · 1 comment

Comments

@mspanish
Copy link

It seems like parsing to JSON is sort of a costly unnecessary step for data that is already in CSV format - do you have any way to accommodate for that style of data? Where the fields for the columns would be laid out like:

let fields = ["id", "name", "screen_name", "location", "description", "url", "protected", "followers_count", "friends_count", "listed_count", "created_at", "favourites_count","verified", "statuses_count", "profile_background_image_url_https", "profile_image_url_https" ]

And the values would come in arrays from streaming chunks of CSV. Right now I convert them but it seems like there must be a better way :)

@ota-meshi
Copy link
Member

Does that mean the records are in an array?
If so, field can be a function that gets the value from the record. You may be able to use this.

   {
     // ...
     field: record => record[0], // id
     // ...
   },
   {
     // ...
     field: record => record[1], // name
     // ...
   }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants