João Pimentel Ferreira

Results 296 comments of João Pimentel Ferreira

IMHO this lib does not have to support all types of incorrectly formated CSV files, there are users already complaining about the size of the lib. You have to preprocess...

Maybe I was not clear enough, this module allows `fromStream` method which you may use to preprocess the file. Non-tested code, something like this ```js const fs = require('fs') const...

It seems is supported, read the docs ```js const request=require('request') const csv=require('csvtojson') csv() .fromStream(request.get('http://mywebsite.com/mycsvfile.csv')) .subscribe((json)=>{ return new Promise((resolve,reject)=>{ // long operation for each json e.g. transform / write into database....

true, double negation might be a issue, but the docs are quite clear IMHO https://github.com/Keyang/node-csvtojson#header-row

Use node `fromStream` method with `createReadStream` ```js const fs = require('fs') const csv = require('csvtojson') csv() .fromStream(fs.createReadStream('/path/to/file', { encoding: 'base64' })) .subscribe((json) => { console.log(json) }, (err) => { throw...

got it, though IMHO it is not a purpose of this module to do this type of conversions, anyway you can check this https://stackoverflow.com/questions/48534404/create-readstream-from-base64-encoded-string-by-file

The original file is a text file, thus string type comes by default. You can set `checkType` to `true` or use the [built-in-parsers](https://github.com/Keyang/node-csvtojson#built-in-parsers)

what is `res` inside `fromString(res)`? `res` should be string you're parsing from ```js csv() .fromString('a.b,a.c') .subscribe((jsonObj)=>{ console.log(jsonObj) }) ```

Does the CSV file contain the quotes? Have you also tried changing the `quote` option > quote: If a column contains delimiter, it is able to use quote character to...

I read now you say you're using `fromString()`. What is the string exactly?