I would like to know how to extract all the numbers after the ID (KC000001-3), including the number set after a tap using Perl regex.
The additional number (0.50) for the first ID, (0.60) second ID, and (0.70 0.80) third ID is always starting with a space as a new line and ending up with another tap.
Input file.
KC000001 0.30 0.40 0.50
KC000002 0.30 0.40 0.50 0.60
KC152363 0.30 0.40 0.50 0.60 0.70 0.80
I would like to get this output file.
0.30 0.40 0.50
0.30 0.40 0.50 0.60
0.30 0.40 0.50 0.60 0.70 0.80
I have prepared this regex.
if ($linea =~ /^(.[a-z0-9]\d+.\d)\s(.?)$/){
print $line
}
However, it is giving me the following error (it is not printing the number after the tab (0.50 for the first), (0.60 for the second), and (0.70 0.80 for the third))
0.30 0.40
0.30 0.40 0.50
0.30 0.40 0.50 0.60
I would like to know what is wrong with this regex. Is it possible to make it with a regex only?
Input file.
KC000001 0.30 0.40 0.50
KC000002 0.30 0.40 0.50 0.60
KC152363 0.30 0.40 0.50 0.60 0.70 0.80
Output file
0.30 0.40
0.30 0.40 0.50
0.30 0.40 0.50 0.60