I have a file that contain lines that looks like this:
>AF001546_1 [88 - 462] 1 MGQQ
>AF001543_1 [88 - 261] ACGT
Not that each line can contain 6 OR 5 fields. What I want to do is to capture Fields 1,2,3(num only), 5(num only) and last field (ACGT or MGOQ strings).
So the expected output is this:
>AF001546_1 88 462 MGQQ
>AF001543_1 88 261 ACGT
Now the perl one-liner I used is this, but failed:
perl -lne 'print "$1 $2 $3 $4" if /(\w+)_\d+\D+(\d+)\D+(\d+)\](\D+)/'
What is the right way to do it?