in reply to Split tab-separated file into separate files, based on column name
please note that
D:\tmp>del id,name,position D:\tmp>perl -lanE "if (@FH) {print $_ shift @F for @FH} else {open $FH +[$x++], '>', $_ for @F}" data.txt D:\tmp>type data.txt, id,name,position data.txt id name position 1 Nick boss 2 George CEO 3 Christina CTO id 1 2 3 name Nick George Christina position boss CEO CTO
eliminated bug
Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Split tab-separated file into separate files, based on column name (updated)
by LanX (Saint) on Aug 27, 2020 at 16:36 UTC | |
by jcb (Parson) on Aug 28, 2020 at 01:17 UTC | |
by LanX (Saint) on Aug 28, 2020 at 07:25 UTC | |
by jcb (Parson) on Aug 28, 2020 at 23:26 UTC | |
by LanX (Saint) on Aug 28, 2020 at 23:58 UTC |