Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Strange output problem

by Riales (Hermit)
on Apr 12, 2012 at 17:24 UTC ( #964792=note: print w/ replies, xml ) Need Help??


in reply to Strange output problem

Nothing jumps out at me, but I am inclined to agree with your guess about the problem being in the last part of the code. Have you tried adding print statements before the chomp, before the substitution, and after the substitution?

while (<$new_in_file>) { print "BEFORE CHOMP: $_\n"; chomp; next if $. == 1; # remove header line s/POS/SAMPLE/ if $. == 2; s/\s+/,/g if $. == 2; # replace whitespace with a comma on I +D row next if $. >= 3 and $. <= 9; # remove unwanted lines print "BEFORE SUBSTITUTION: $_\n"; s/\s+(\d)\|(\d)\S+/,$1 $2/g; # clean up the SNPs & put into CSV + format print "AFTER SUBSTITUTION: $_\n"; print $new_out_file "$_\n"; }


Comment on Re: Strange output problem
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://964792]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (6)
As of 2014-12-29 05:19 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (184 votes), past polls