Skip to main content
fixed typo and added link
Source Link
Chris Davies
  • 128.5k
  • 16
  • 179
  • 325

The multi line is a feature of a CSV cell, and you can use an utility that is CSV aware as Miller.

As examples, if you have this CSV you can run

  • mlr --csv cut -f fieldA acr.csv to cut the first column
  • mlr --icsv --ojson cut -f fieldA acr.csv to cut the first column and convert all to JSON
[ { "fieldA": "That's an important note,\nsome extra infos\nConcerning a password\nIpsum" }, { "fieldA": "hello" } ] 

As you can see Miller is aware of cell carriage return (RFC480RFC4180 compliant).

Below an image of the sample input file.

enter image description here

The multi line is a feature of a CSV cell, and you can use an utility that is CSV aware as Miller.

As examples, if you have this CSV you can run

  • mlr --csv cut -f fieldA acr.csv to cut the first column
  • mlr --icsv --ojson cut -f fieldA acr.csv to cut the first column and convert all to JSON
[ { "fieldA": "That's an important note,\nsome extra infos\nConcerning a password\nIpsum" }, { "fieldA": "hello" } ] 

As you can see Miller is aware of cell carriage return (RFC480 compliant).

Below an image of the sample input file.

enter image description here

The multi line is a feature of a CSV cell, and you can use an utility that is CSV aware as Miller.

As examples, if you have this CSV you can run

  • mlr --csv cut -f fieldA acr.csv to cut the first column
  • mlr --icsv --ojson cut -f fieldA acr.csv to cut the first column and convert all to JSON
[ { "fieldA": "That's an important note,\nsome extra infos\nConcerning a password\nIpsum" }, { "fieldA": "hello" } ] 

As you can see Miller is aware of cell carriage return (RFC4180 compliant).

Below an image of the sample input file.

enter image description here

Source Link
aborruso
  • 2.7k
  • 14
  • 31

The multi line is a feature of a CSV cell, and you can use an utility that is CSV aware as Miller.

As examples, if you have this CSV you can run

  • mlr --csv cut -f fieldA acr.csv to cut the first column
  • mlr --icsv --ojson cut -f fieldA acr.csv to cut the first column and convert all to JSON
[ { "fieldA": "That's an important note,\nsome extra infos\nConcerning a password\nIpsum" }, { "fieldA": "hello" } ] 

As you can see Miller is aware of cell carriage return (RFC480 compliant).

Below an image of the sample input file.

enter image description here