Hi! Guys
Could you help me straighten this script?
Thanks in advance
the script i have sofar....
#!/usr/bin/perl -w
open(DATA,"<in.txt") || die("Missing File");
while ($inc = <DATA>) {
@header = ($inc =~ /^#.*/g);
($val) = ($inc =~ /([ABC] GO:.*)/);
foreach $io (@header) {
print "$io $val\n";
}
}
my sample input data...
#J1_67_L_TC_O3-Z05-SP6.faa 1 2005
A GO:539284565 ALLIANCE AXIS
B GO:74356886 principal and earned interest
B GO:74356886 principal and earned interest
C GO:89068867 INTRAMURAL INVESTIGATION
#C1_67_L_TC_P3-R01-SP6.fca 1 2001
A GO:80201220 principal and earned interest
B GO:45639012 cost of credit
B GO:45639012 cost of credit
B GO:45639012 cost of credit
#T1_67_L_TC_N3-H02-SP6.fas 1 2004
B GO:12324566 automated clearinghouse (ACH)
C GO:54923950 depositor's savings account
my desired output as tab delimited text....
#J1_67_L_TC_O3-Z05-SP6.faa 1 2005 A GO:539284565 ALLIANCE AXIS B GO:74356886 principal and earned interest C GO:89068867 INTRAMURAL INVESTIGATION
#C1_67_L_TC_P3-R01-SP6.fca 1 2001 A GO:80201220 principal and earned interest B GO:45639012 cost of credit
#T1_67_L_TC_N3-H02-SP6.fas 1 2004 B GO:12324566 automated clearinghouse (ACH) C GO:54923950 depositor's savings account
Could you help me straighten this script?
Thanks in advance
the script i have sofar....
#!/usr/bin/perl -w
open(DATA,"<in.txt") || die("Missing File");
while ($inc = <DATA>) {
@header = ($inc =~ /^#.*/g);
($val) = ($inc =~ /([ABC] GO:.*)/);
foreach $io (@header) {
print "$io $val\n";
}
}
my sample input data...
#J1_67_L_TC_O3-Z05-SP6.faa 1 2005
A GO:539284565 ALLIANCE AXIS
B GO:74356886 principal and earned interest
B GO:74356886 principal and earned interest
C GO:89068867 INTRAMURAL INVESTIGATION
#C1_67_L_TC_P3-R01-SP6.fca 1 2001
A GO:80201220 principal and earned interest
B GO:45639012 cost of credit
B GO:45639012 cost of credit
B GO:45639012 cost of credit
#T1_67_L_TC_N3-H02-SP6.fas 1 2004
B GO:12324566 automated clearinghouse (ACH)
C GO:54923950 depositor's savings account
my desired output as tab delimited text....
#J1_67_L_TC_O3-Z05-SP6.faa 1 2005 A GO:539284565 ALLIANCE AXIS B GO:74356886 principal and earned interest C GO:89068867 INTRAMURAL INVESTIGATION
#C1_67_L_TC_P3-R01-SP6.fca 1 2001 A GO:80201220 principal and earned interest B GO:45639012 cost of credit
#T1_67_L_TC_N3-H02-SP6.fas 1 2004 B GO:12324566 automated clearinghouse (ACH) C GO:54923950 depositor's savings account