Hi, i'm trying to write a script to read this
YAL044W-A 0000004
YAL044W-A 0005554
YAL044W-A 0008372
and convert into this
YAL044W-A 0000004, 0005554, 0008372
unfortunately, this is as far as i get
open FH, "<infile.txt" or die $!;
open OF, ">outputfile.txt";
while (<FH>) {
($key, @values)=split /\s+/, $_;
print "$key \t";
foreach ($key) {
print OF "@values," ;
}
}
thanks for any help
YAL044W-A 0000004
YAL044W-A 0005554
YAL044W-A 0008372
and convert into this
YAL044W-A 0000004, 0005554, 0008372
unfortunately, this is as far as i get
open FH, "<infile.txt" or die $!;
open OF, ">outputfile.txt";
while (<FH>) {
($key, @values)=split /\s+/, $_;
print "$key \t";
foreach ($key) {
print OF "@values," ;
}
}
thanks for any help