in reply to How to continue numbering after a regular expression has been found
while ( <DNAFILE> ) { next if (/fixedStep chrom=chrX start=(.+) step=1/); $counter = $1; } print "$counter\t$_\n";
There are some issues with your code:
as you see, it is quite similar to your awk-code.while ( <DNAFILE> ) { if (/fixedStep chrom=chrX start=(.+) step=1/) { $counter = $1; } else { print "$counter\t$_\n"; $counter++; } }
HTH, Rata
|
|---|