Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am reading through my DATA2 file and printing to DATA3.while (<DATA2>) { $line=<DATA2>; print $line; @array = split(/ /, $line); #split the line up into array s +o [0] is the id and [1] indel 1 etc. #print $array[0]; #print "\n"; foreach $indel (@array) #look at each indel in turn { next if $indel=~/>/; #skip the id @character = split(//, $indel); #look a character at a time foreach $char (@character) { if ($char=~/-/) { #if there is a gap add 1 to $count $count++; } } if($go==0) #if id hasnt been printed yet { print DATA3 "$array[0]"; print DATA3 "\n"; $go++; } @letter = qw(A B C D E F G H I J K L M N O P Q R S T U V W X Y Z); + #converting numbers into letters A=0 etc. print DATA3 "$letter[$count]"; $count=0; } print DATA3 "\n"; $go=0; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: rewinding filehandle/line skipping ?
by Molt (Chaplain) on Jun 10, 2002 at 10:07 UTC | |
|
Re: rewinding filehandle/line skipping ?
by Zaxo (Archbishop) on Jun 10, 2002 at 10:19 UTC | |
|
Re: rewinding filehandle/line skipping ?
by jmcnamara (Monsignor) on Jun 10, 2002 at 10:34 UTC | |
|
Re: rewinding filehandle/line skipping ?
by cjf (Parson) on Jun 10, 2002 at 11:59 UTC | |
|
Re: rewinding filehandle/line skipping ?
by Anonymous Monk on Jun 10, 2002 at 10:19 UTC | |
|
Re: rewinding filehandle/line skipping ?
by cybear (Monk) on Jun 10, 2002 at 10:48 UTC |