Skip to content

Commit 610a945

Browse files
committed
s
1 parent efcf5ff commit 610a945

1 file changed

Lines changed: 20 additions & 20 deletions

File tree

README.rst

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -24,49 +24,49 @@ cat the raw.json to csv/xls use command line tool
2424

2525
.. code-block:: bash
2626
27-
cat raw.json| jsoncsv | mkexcel > output.csv
28-
cat raw.json| jsoncsv | mkexcel -t xls > output.xls
27+
cat raw.json| jsoncsv | mkexcel > output.csv
28+
cat raw.json| jsoncsv | mkexcel -t xls > output.xls
2929
3030
make sure each line of raw json text file is a json object
3131

3232
.. code-block:: bash
3333
34-
$cat raw.json
35-
{"id":1, "name":"A", "year": 2015}
36-
{"id":2, "name":"S", "zone": "china"}
37-
$cat raw.json | jsoncsv | mkexcel > output.csv
38-
$cat output.csv
39-
id,name,year,zone
40-
1,A,2015,
41-
2,S,,china
34+
$cat raw.json
35+
{"id":1, "name":"A", "year": 2015}
36+
{"id":2, "name":"S", "zone": "china"}
37+
$cat raw.json | jsoncsv | mkexcel > output.csv
38+
$cat output.csv
39+
id,name,year,zone
40+
1,A,2015,
41+
2,S,,china
4242
4343
This is easily and needn't care the different keys from any two object.
4444

4545
if input file is an json_array, use `-A/--array` to decode it
4646

4747
.. code-block:: bash
4848
49-
$cat raw.json
50-
[{"id":1, "name":"A", "year": 2015}, {"id":2, "name":"S", "zone": "china"}]
51-
$cat raw.json | jsoncsv -A | mkexcel > output.csv
52-
$cat output.csv
53-
id,name,year,zone
54-
1,A,2015,
55-
2,S,,china
49+
$cat raw.json
50+
[{"id":1, "name":"A", "year": 2015}, {"id":2, "name":"S", "zone": "china"}]
51+
$cat raw.json | jsoncsv -A | mkexcel > output.csv
52+
$cat output.csv
53+
id,name,year,zone
54+
1,A,2015,
55+
2,S,,china
5656
5757
another way to convert file step by step
5858

5959
.. code-block:: bash
6060
61-
$jsoncsv raw.json expand.json
62-
$mkexcel expand.json -t xls output.xls
61+
$jsoncsv raw.json expand.json
62+
$mkexcel expand.json -t xls output.xls
6363
6464
get more options with `--help`.
6565

6666
.. code-block:: bash
6767
6868
jsoncsv --help
69-
mkexcel --help
69+
mkexcel --help
7070
7171
Install
7272
================

0 commit comments

Comments
 (0)