Closed MostafaYA closed 1 year ago
Just realised another solution outside csvtk
.
datamash -s --header-in --header-out crosstab 1,2 < example.tsv
It would be however nice to have it with csvtk
to reduce dependencies
I will implement it.
Implemented. Use binaries here: https://github.com/shenwei356/csvtk/issues/91#issuecomment-1674416824
$ csvtk spread -t -k pattern -v value example.txt | csvtk csv2md -t
id | a | b | c | d | e | f | g | h | i | j | k |
---|---|---|---|---|---|---|---|---|---|---|---|
s1 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
s2 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | |
s3 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 |
Prerequisites
csvtk version
Describe your issue
and want to get an output like the one below. Pattern as a header, id as row name.
I am doing the following that looks a bit inelegant solution. I beleive there might be a functionality within csvtk to do this better but am not aware of it. Can you please guide?
Thank you
I'm grateful to users who have greatly helped to report bugs and suggested new features.
I may respond to issues or fix bugs quickly, but I usually implement new features periodically (two or more weeks).