parsing - In perl, how to loop through file, parse line and then compare all values of the line? -


i'm new perl , trying figure out how parse lines within tab-delimited file , compare values parsed lines value , print line.

for example: want print out lines have numbers greater 3.

a 2.4 6.9 3.1

b 10.2 3.4 7.6

c 1.9 2.6 2.3

i output

b 10.2 3.4 7.6

because b line numbers greater 3

thanks in advance

  • use text::csv cpan module parse tab-separated file array of arrays

  • loop on records. each record

    • check if fields 1,2, , 3 bigger threshold value. 3 fields, use simple "if", large # of fields, use grep

    • if fields bigger, print record stdout


Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - Need to add SOAP security token -

java - EclipseLink JPA Object is not a known entity type -