in reply to Re: Parsing and Modifying a flat file in perl
in thread Parsing and Modifying a flat file in perl

I will keep in mind about the things you mentioned above (sorry about Formatting, this was my first post).

I was trying something like this (just a snippet of my code):

$scafSeq = $ARGV[0]; open (IN, "< $scafSeq"); while ( $line = <IN> ) { chomp $line; $line =~ s/^\s+//g; $line =~ s/sequence/count/g; next if $line eq ""; if(substr($line,0,1) eq ">") { ($scaff) = $line =~ /^>(\S+)/; } else { $scaffData -> {$scaff} .= $line; } }

And then I sort the keys and split it with N. Although this approach was sorting the data for >sequence1, etc , it was not working for >C1113456... data.

Your code is short and effective, to do this job. Thanks!