<HTML><HEAD></HEAD>
<BODY dir=ltr>
<DIV dir=ltr>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">
<DIV>
<DIV>How about something like this:</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV> </DIV>
<DIV>my $x = <>; chomp $x;<BR>my @headings = split(/,/, $x);</DIV>
<DIV></DIV>
<DIV></DIV>
<DIV> </DIV>
<DIV>my $y = <>; chomp $y;<BR>my @data = split(/,/, $y);</DIV>
<DIV></DIV>
<DIV> </DIV>
<DIV>foreach my $i (0 .. $#headings) {<BR> print
"$headings[$i]=$data[$i]\n";<BR>}</DIV>
<DIV> </DIV>
<DIV></DIV>
<DIV>Indy Singh<BR>IndigoSTAR Software -- www.indigostar.com</DIV></DIV>
<DIV> </DIV>
<DIV style="FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: 12pt">Indy
Singh<BR>IndigoSTAR Software -- www.indigostar.com</DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV style="FONT: 10pt tahoma">
<DIV> </DIV>
<DIV style="BACKGROUND: #f5f5f5">
<DIV style="font-color: black"><B>From:</B> <A title=antoniosun@lavabit.com
href="mailto:antoniosun@lavabit.com">Antonio Sun</A> </DIV>
<DIV><B>Sent:</B> Wednesday, May 22, 2013 10:51 AM</DIV>
<DIV><B>To:</B> <A title=toronto-pm@pm.org
href="mailto:toronto-pm@pm.org">TPM</A> </DIV>
<DIV><B>Subject:</B> Re: [tpm] Pivot record dump</DIV></DIV></DIV>
<DIV> </DIV></DIV>
<DIV
style="FONT-STYLE: normal; DISPLAY: inline; FONT-FAMILY: 'Calibri'; COLOR: #000000; FONT-SIZE: small; FONT-WEIGHT: normal; TEXT-DECORATION: none">
<DIV dir=ltr>Sorry, forgot to mention...<BR>
<DIV class=gmail_extra><BR><BR>
<DIV class=gmail_quote>On Wed, May 22, 2013 at 10:47 AM, Antonio Sun <SPAN
dir=ltr><<A href="mailto:antoniosun@lavabit.com"
target=_blank>antoniosun@lavabit.com</A>></SPAN> wrote:<BR>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV dir=ltr>Hi,
<DIV> </DIV>
<DIV>I'm wondering what's the best approach to pivot a record dump. </DIV>
<DIV> </DIV>
<DIV>My simple record dump will be consists of two lines, first header then
the record, with each field/header-name separated with \t. </DIV>
<DIV> </DIV>
<DIV>Here is an example:</DIV>
<DIV> </DIV>
<DIV>Id\tFirstN\tLastN\t...</DIV>
<DIV>1\tSam\tSmith\t...</DIV></DIV></BLOCKQUOTE>
<DIV> </DIV>
<DIV>And the pivoted result would be:</DIV>
<DIV> </DIV>
<DIV>Id=1<BR></DIV>
<DIV>FirstN=Sam<BR></DIV>
<DIV>LastN=Smith<BR></DIV>
<DIV>...</DIV>
<DIV> </DIV>
<BLOCKQUOTE
style="BORDER-LEFT: rgb(204,204,204) 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex"
class=gmail_quote>
<DIV dir=ltr>
<DIV></DIV>
<DIV>Also, if you think it can be done with normal *nix tools, without using
Perl, I'm very much interested to know as well. </DIV>
<DIV> </DIV>
<DIV>Thanks</DIV><SPAN><FONT color=#888888>
<DIV> </DIV>
<DIV>Antonio</DIV>
<DIV> </DIV></FONT></SPAN></DIV></BLOCKQUOTE></DIV>
<DIV> </DIV></DIV></DIV>
<P>
<HR>
_______________________________________________<BR>toronto-pm mailing
list<BR>toronto-pm@pm.org<BR>http://mail.pm.org/mailman/listinfo/toronto-pm<BR></DIV></DIV></DIV></BODY></HTML>