Skip to end of metadata
Go to start of metadata

csv-shape is a new utility for various operations on reshaping csv data.

For now, only one operation is implemented: concatenate:

Concatenate by Grouping Input Records

> ( echo 1,a; echo 2,b; echo 3,c; echo 4,d; ) | csv-shape concatenate -n 2
1,a,2,b
3,c,4,d

Note: For ascii text inputs the records do not have to be regular or even have the same number of fields.

Concatenate by Sliding Window

ASCII:

> ( echo 1,a; echo 2,b; echo 3,c; echo 4,d; ) | csv-shape concatenate -n 2 --sliding-window
1,a,2,b
2,b,3,c
3,c,4,d

Binary:

> ( echo 1,a; echo 2,b; echo 3,c; echo 4,d; ) | csv-to-bin ui,c | csv-shape concatenate -n 2 --sliding-window --binary ui,c | csv-from-bin ui,c,ui,c
1,a,2,b
2,b,3,c
3,c,4,d
  • No labels