How would columns of data for a block of text:
nicholas@mordor:~/powershell$
nicholas@mordor:~/powershell$ cat multiple_lines.data
a 4
b 5
d 6
e 7
nicholas@mordor:~/powershell$
nicholas@mordor:~/powershell$ datamash transpose < multiple_lines.data > transposed.data
nicholas@mordor:~/powershell$
nicholas@mordor:~/powershell$ cat transposed.data
a 4 b 5 d 6 e 7
nicholas@mordor:~/powershell$
nicholas@mordor:~/powershell$ datamash transpose < transposed.data
a 4
b 5
d 6
e 7
nicholas@mordor:~/powershell$
be fed into a CSV
type file so that column a
has the value 4
, etc? Here c
has been omitted, but it can be assumed to be present. Or, at least that missing columns can be added.
No doubt awk
would be fantastic at grabbing the above numbers, but looking to use PowerShell
here. Output to json
or xml
would be just as good as CSV
, most any sort of output like data interchange format would be fine.
Assuming an array of such blocks.