Skip to main content
added 207 characters in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

For example, with Miller,

$ mlr --csv nest --ivar ';' -f colour file.csv
item,type,colour
item1,itemtype,blue;grey
item2,itemtype,blue
item2,itemtype2,orange;blue
item3,itemtype,blue

For example, with Miller,

$ mlr --csv nest --ivar ';' -f colour file.csv
item,type,colour
item1,itemtype,blue;grey
item2,itemtype,blue
item2,itemtype2,orange;blue
item3,itemtype,blue
added 293 characters in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

For example, the given data could be transformed into CSV:

item,type,colour
item1,itemtype,blue
item1,itemtype,grey
item2,itemtype,blue
item2,itemtype2,orange
item2,itemtype2,blue
item3,itemtype,blue

... or into an equivalent database table, and then worked on from there.

For example, the given data could be transformed into CSV:

item,type,colour
item1,itemtype,blue
item1,itemtype,grey
item2,itemtype,blue
item2,itemtype2,orange
item2,itemtype2,blue
item3,itemtype,blue

... or into an equivalent database table, and then worked on from there.

added 293 characters in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k

If jq becomes difficult to run for larger inputs (a linear extrapolation suggest it should take me about 54 hours to run a 1 GB data set), you may want to look into processing the data in some way (potentially in a database or at least work with the data in some other format which is not JSON).

If jq becomes difficult to run for larger inputs (a linear extrapolation suggest it should take me about 54 hours to run a 1 GB data set), you may want to look into processing the data in some way (potentially in a database or at least work with the data in some other format which is not JSON).

added 460 characters in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k
Loading
added 635 characters in body
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k
Loading
Source Link
Kusalananda
  • 355.8k
  • 42
  • 735
  • 1.1k
Loading