Re: Extracting Columns from tab delimited files

2013-02-10 Thread timothy adigun
Hi Hori, Please check below for my comments on your code. On 11 Feb 2013 03:00, "Tiago Hori" wrote: > > Hi All, > > I am trying to force myself to not use one of perl's modules to parse tab > delimited files (like TXT::CSV), so Are you referring to module Text::CSV and it's cousin Text::CSV_XS? pl

Extracting Columns from tab delimited files

2013-02-10 Thread Tiago Hori
Hi All, I am trying to force myself to not use one of perl's modules to parse tab delimited files (like TXT::CSV), so please be patient and don't tell me just to go and use them. I am trying to re-ivent the wheel, so to speak, because as we do with science, we repeat experiments to lean about the

Re: matching certain lines

2013-02-10 Thread Chris Stinemetz
On Sun, Feb 10, 2013 at 8:05 AM, Chris Stinemetz wrote: > To take this a step further. > > How would you go about creating a hash to sum up all the values in group > $3 utilizing the flip/flop operator and print the results of the key and > value with the key being group $2? > > This is what I cam

Re: matching certain lines

2013-02-10 Thread Chris Stinemetz
To take this a step further. How would you go about creating a hash to sum up all the values in group $3 utilizing the flip/flop operator and print the results of the key and value with the key being group $2? Thank you, Chris while( ) { if ( /0x3\|68\|/ .. /^#END/ ) { print if /\|

Re: matching certain lines

2013-02-10 Thread Chris Stinemetz
Thank you everyone for you help. -Chris On Sat, Feb 9, 2013 at 5:15 PM, Uri Guttman wrote: > On 02/09/2013 03:59 PM, John W. Krahn wrote: > > >> Let's re-factor that down to its essence: >> >> while ( ) { >> print if /\|68\|/; >> print "$1\t$2\t$3\n" if /(\|\d)\|(\d+)\|(\d+)/; >>