my problem is I have some data like this in a file=
AB:110256
aattggcaatgc
AB:1569854
ttgcttgcaa
aatcgcttttaa
ttttaaatgc
AB:569587
atgccttcat
cctcggattaag
I need to develop a programme,which will create multiple files according to the AB number (like AB:569587 will be one file)
and put each sequence in their corresponding files.like:
ttgcttgcaa
aatcgcttttaa
ttttaaatgc
this sequence will be put in the AB:1569854 file.
I have so far made a code which makes files according to the AB numbers,that is:
Expand|Select|Wrap|Line Numbers
- ..
- #!usr/bin/perl -w
- open(FH,"h.txt")or die "cant open file";
- @a=<FH>;
- foreach $line(@a){
- open(FHO,">$line") ;
- }
- close FH;
- close FHO;
- ..
plz help