[tpm] Pivot record dump

Indy Singh indy at indigostar.com
Wed May 22 09:01:31 PDT 2013


How about something like this:

my $x = <>; chomp $x;
my @headings = split(/,/, $x);

my $y = <>; chomp $y;
my @data = split(/,/, $y);

foreach my $i (0 .. $#headings) {
  print "$headings[$i]=$data[$i]\n";
}

Indy Singh
IndigoSTAR Software -- www.indigostar.com

Indy Singh
IndigoSTAR Software -- www.indigostar.com

From: Antonio Sun 
Sent: Wednesday, May 22, 2013 10:51 AM
To: TPM 
Subject: Re: [tpm] Pivot record dump

Sorry, forgot to mention...




On Wed, May 22, 2013 at 10:47 AM, Antonio Sun <antoniosun at lavabit.com> wrote:

  Hi,  

  I'm wondering what's the best approach to pivot a record dump. 

  My simple record dump will be consists of two lines, first header then the record, with each field/header-name separated with \t. 

  Here is an example:

  Id\tFirstN\tLastN\t...
  1\tSam\tSmith\t...

And the pivoted result would be:

Id=1

FirstN=Sam

LastN=Smith

...

  Also, if you think it can be done with normal *nix tools, without using Perl, I'm very much interested to know as well. 

  Thanks

  Antonio




--------------------------------------------------------------------------------
_______________________________________________
toronto-pm mailing list
toronto-pm at pm.org
http://mail.pm.org/mailman/listinfo/toronto-pm
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.pm.org/pipermail/toronto-pm/attachments/20130522/cf98c640/attachment.html>


More information about the toronto-pm mailing list