Comments (3)
hey @juanjoDiaz can you please help me out here?
from json2csv.
Hi,
Sorry for the late response.
I'm quite busy at the moment and won't be able to spend time on this for at least a couple of weeks.
A couple of things at glance:
You are missing a space in front of the -o
:
json2csv -i unsupported_json.json --unwind visits.23andme.com,visits.23andme.com.visits -f visits.23andme.com.source_type,visits.23andme.com.visits.date,visits.23andme.com.visits.organic,visits.23andme.com.visits.paid -o traffic.csv
Having a field named 23andme.com
is problematic.
When you unwind on visits.23andme.com
, json2csv tries to unwind a field named com
in the field named 23andme
in the object named visits
. This is:
{
"visits": {
"23andme": {
"com": [/* object to unwind */]
}
}
}
You can solved this using the programatic API:
const opts = {
transforms: [unwind({ paths: [["visits", "23andme.com"], ["visits", "23andme.com", "visits"]] })]
};
but you won't be able to work around this using the CLI.
The same thing applies to the fields and the -f
option of the CLI.
Hope this helps! 🙂
from json2csv.
Thanks @juanjoDiaz for finding some time to respond.
This was helpful to get the confirmation and also a workaround which is via programmatic API.
from json2csv.
Related Issues (20)
- CSV not breaking lines HOT 2
- promise() not listen for 'close' event HOT 2
- Replace docpress with docusaurus or similar HOT 1
- csv2json HOT 1
- Changelog is not updated in master HOT 1
- \r ends the line even if eol option is set to \n HOT 2
- Validation/skipping objects HOT 2
- Documentation: missing the type of Parser.parse() return value ( Synchronous API ) HOT 1
- how can we input output multiple files from CLI? HOT 1
- convert to esm HOT 2
- Data transforms error handling HOT 3
- Can't use default formatters in version 5.0.7 HOT 1
- how to use transform
- 6.0.0-alpha.2 version set to latest stable version HOT 1
- BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. HOT 3
- "Transforms" options cause out-of-memory-error HOT 1
- How to specify flattened columns with argument "fields"? HOT 1
- the first object in array defines the schema and results in missing fields in csv output HOT 1
- only up to 32759 characters can be output in a cell
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from json2csv.