2008/6/25 Eng. Fadhl Al_Akwaa <[EMAIL PROTECTED]>:
>
> Hi All
> I could not do it with matlab could perl do it?
> I appreciate if I have solution for this problem
> I try to extract two columns from a text file(8 columns) with variable
> number of headerlines, and variable line length.
> below is one line of my data
>
>
> S= 'GO:0000022 0.00312066574202497 9/2884 1/597 0.0023457 NA mitotic
>
> spindle elongation YBL084C '
>
> How could I get column 4 , 5 using perl.
This is one way
open (FILE,"file.txt") or die "can't open file";
open (DESTINATION,'newfile.txt') or die "can't open file";
while(<FILE>){
my ($col1, $col2, $col3, $col4, $col5) = split(/[\s\t]/,$_);
print DESTINATION "$col4 $col5";
}
close DESTINATION;
close FILE;
>
> Fadl
> Fadhl M. Al-Akwaa Biomedical Engineering, PhD Student
>
>
>
>
>
--
David Romero
www.factufacil.com.mx
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/