I have a data file that looks something like this:
1 ABABAB 123456 2223 0.626903553299492
1 ABABAB 123465 60 0.0169204737732657
2 ABABAB 123546 60 0.0169204737732657
1 ABABAB 123564 9 0.00253807106598985
7 AABBAB 123645 8 0.00225606316976875
1 ABABAB 123654 13 0.00366610265087422
10 AAABBB 124356 131 0.0369430344049633
What I want to do is put all this information into an array, splitting it on \t but then further splitting columns 2 and 3 (e. g. ABABAB, 123456) by character so that the letters and numbers will each be in a separate element of the array.
I know how I can use split to split up everything by where the tabs are @array=(/\t/, $line) or everything by character @array=(//, $line), but I can't figure out how to tell it to split differently depending on which column its on.
Is there a simple way to do this?
1 ABABAB 123456 2223 0.626903553299492
1 ABABAB 123465 60 0.0169204737732657
2 ABABAB 123546 60 0.0169204737732657
1 ABABAB 123564 9 0.00253807106598985
7 AABBAB 123645 8 0.00225606316976875
1 ABABAB 123654 13 0.00366610265087422
10 AAABBB 124356 131 0.0369430344049633
What I want to do is put all this information into an array, splitting it on \t but then further splitting columns 2 and 3 (e. g. ABABAB, 123456) by character so that the letters and numbers will each be in a separate element of the array.
I know how I can use split to split up everything by where the tabs are @array=(/\t/, $line) or everything by character @array=(//, $line), but I can't figure out how to tell it to split differently depending on which column its on.
Is there a simple way to do this?