Given a file like so
First, Last, Age
Cory, Klein, 27
John Jacob, Smith, 30
Is there a command line utility to transpose the contents so the output appears like so
First, Cory, John Jacob
Last, Klein, Smith
Age, 27, 30
|
Given a file like so
Is there a command line utility to transpose the contents so the output appears like so
|
|||||
|
|
CSV parsing is not easily done with POSIX tools only, unless you are using a simplified CSV variant with no quoting (so that commas can't appear in a field). Even then this task doesn't seem easy to do with awk or other text processing to tool. You can use Perl with For example, in Python:
|
||||
|
|
|
A quick & dirty bash solution :
|
|||||||||
|