jehiah / json2csv

command line tool to convert json to csv
MIT License
802 stars 94 forks source link

running problems #27

Closed johannnnnnn closed 9 years ago

johannnnnnn commented 9 years ago

Hi!!

I've installed json2csv by

$go get github.com/jehiah/json2csv

but when I try to do

$cat someFile.json | json2csv -k time,tx_index > output.csv

then I get the following:

2015/04/28 17:18:20 ERROR Decoding JSON at line 1: unexpected end of JSON input { 2015/04/28 17:18:20 ERROR Decoding JSON at line 2: invalid character ':' after top-level value "time": 1348310820, 2015/04/28 17:18:20 ERROR Decoding JSON at line 3: invalid character ':' after top-level value "tx_index": 9741630 2015/04/28 17:18:20 ERROR Decoding JSON at line 4: invalid character '}' looking for beginning of value }

and so on... What am I missing?

Thank you for you time.

thinkjson commented 9 years ago

json2csv expects one object per line.

On Tue, Apr 28, 2015 at 12:58 PM, johannnnnnn notifications@github.com wrote:

Hi!!

I've installed json2csv by

$go get github.com/jehiah/json2csv

but when I try to do

$cat someFile.json | json2csv -k time,tx_index > output.csv

then I get the following:

2015/04/28 17:18:20 ERROR Decoding JSON at line 1: unexpected end of JSON input { 2015/04/28 17:18:20 ERROR Decoding JSON at line 2: invalid character ':' after top-level value "time": 1348310820, 2015/04/28 17:18:20 ERROR Decoding JSON at line 3: invalid character ':' after top-level value "tx_index": 9741630 2015/04/28 17:18:20 ERROR Decoding JSON at line 4: invalid character '}' looking for beginning of value }

and so on... What am I missing?

Thank you for you time.

— Reply to this email directly or view it on GitHub https://github.com/jehiah/json2csv/issues/27.

ladyrassilon commented 9 years ago

Can you supply an example?