首先,来看perl把文件的一行变为两行的代码。
#!/usr/bin/perl
open(INFILE, "E:/10000_seq.txt");
open(OUTFILE, ">E:/11.txt")|| die "Cannot open the newfile: $!n";;
while (<INFILE>) {
s/^/>/g;
s/s+/n/g;
print OUTFILE "$_";
}
exit;
其次,来看perl把文件的连续两行变为一行的代码。
#!/usr/bin/perl
open(INFILE, "E:/11seq.txt");
open(OUTFILE, ">E:/11.txt")|| die "Cannot open the newfile: $!n";;
while (<INFILE>) {
s/Query= (w+)n/Query=$1 /g;
print OUTFILE "$_";
}
exit;