Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
ftsI,DB00303 HDC,DB00114; DB00117 F13A1,DB01839; DB02340; DB11311; DB13151
into
ftsI,DB00303 HDC,DB00114 HDC,DB00117 F13A1,DB01839 F13A1,DB02340 F13A1,DB11311 F13A1,DB13151
The point of this is to go from a one to many mapping line by line, to a one to one mapping line by line ( at least with respect to the fields in question.
Something like the following is what I am looking for ... I know this syntax is wrong but hoping that it will get the conceptual point across....
cat file|cut-f1,10|perl -pe 'foreach $entry (@F[1]){print $F[0] . "\t" . $entry . "\n";}'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl one-liner for array at bash shell
by Anonymous Monk on Aug 22, 2017 at 21:57 UTC | |
|
Re: Perl one-liner for array at bash shell
by Anonymous Monk on Aug 22, 2017 at 20:50 UTC | |
by Anonymous Monk on Aug 22, 2017 at 21:03 UTC | |
by Anonymous Monk on Aug 22, 2017 at 21:05 UTC | |
by Anonymous Monk on Aug 22, 2017 at 21:11 UTC | |
by Anonymous Monk on Aug 22, 2017 at 21:18 UTC | |
| |
|
Re: Perl one-liner for array at bash shell
by Anonymous Monk on Aug 22, 2017 at 21:01 UTC | |
by Anonymous Monk on Aug 22, 2017 at 21:06 UTC | |
by Anonymous Monk on Aug 22, 2017 at 21:12 UTC |