Transposing rows and columns: 3 methods

Posted by eldersnake on May 14, 2016 11:36 AM EDT
The Linux Rain; By Bob Mesibov
Mail this story
Print this story

Swapping the rows and columns in a table on the command line would seem to be a fairly easy thing to do [...] Transposing rows and columns is indeed easy if you have the GNU datamash utility on your system [...] I wrote 'trans' as throwaway code for transposing my own tables. It could be extended so that argument 2 specifies the input column separator, and argument 3 a different column separator for the output. There are other ways to swap rows and columns in tables, for example using Perl, but for the time being I'm happy with the script!

Full Story

  Nav
» Read more about: Story Type: Tutorial; Groups: Developer, GNU, Linux, Standards

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.