[csv-transformer] Make a node from each line
See original GitHub issueSummary
CSV is very convenient format because it is imitate relational database. Right now (v 0.1.0) csv-transformer makes one node per csv file. And I didn’t find a way to create referencies across different node types because all data stored in records
field.
Basic example
It is good to have an option for csv-transformer to make one node per line. One column can be a reference to another node type, e.g. category
.
Motivation
It is pretty easy to manage certain types of data in CSV file because you have a bird’s eye view on big data set.
This is pretty much a follow up for #293. @hjvedvik mentioned that we need some changes in core to make it possible. Could you enumerate those blockers.
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Memory-efficient CSV transformation into CSV or text reports ...
CSV files often start with a line like this, where these values are the name for each column. The purpose is similar to...
Read more >csv-transformer - npm
Transforms a CSV file -- well, any delimited file, really, into another file using a template. You can use this as a stand...
Read more >convert CSV lines into Javascript objects - Stack Overflow
What I want to do it get each line of the CSV, convert it to a JavaScript object, store them into an array,...
Read more >How To Read and Write CSV Files in Node.js Using Node-CSV
All the rows in the CSV file have been transformed into arrays using the csv-parse transform stream. Because logging happens each time a...
Read more >csvtojson | Yarn - Package Manager
csvtojson module is a comprehensive nodejs csv parser to convert csv to json or column arrays. It can be used as node.js library...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That’s pretty much how I do it.
yarn add xlsx
.source-xls-plugin
.index.js
insidesource-xls-plugin
:gridsome.config.js
like this:Any update on generating content from CSV files?
I really can’t even figure out how to read a single CSV file and get it into GraphQL.I found out its the same as using Markdown source and the transformer auto detects the csv file. It be great to improve the docs for that plugin just a little bit further.