This will do it, but I don't know how you would score it for comparison.
perl -anF"\|" -le"$f{shift@F}=[@F[1..$#F]]" pipe.txt
And you need this to prove it worked
P:\test>perl -MData::Dumper -anF"\|" -le"$f{shift@F}=[@F[1..$#F]]}{pri
+nt Dumper \%f" pipe.txt
$VAR1 = {
'6' => [
'foo',
'bar',
'bax'
],
'3' => [
'foo',
'bar',
'bax'
],
'7' => [
'foo',
'bar',
'bax'
],
'9' => [
'foo',
'bar',
'bax'
],
'2' => [
'foo',
'bar',
'bax'
],
'8' => [
'foo',
'bar',
'bax'
],
'1' => [
'foo',
'bar',
'bax'
],
'4' => [
'foo',
'bar',
'bax'
],
'10' => [
'foo',
'bar',
'bax'
],
'5' => [
'foo',
'bar',
'bax'
]
};
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|