Dear Friends,
I am in urgent need for awk/sed/sh script for converting a specific data format (.txt) to .xls.
The input is as follows:
>gi|1234|ref|
Query = 1 - 65, Target = 1677 - 1733
Score = 8.38, E = 0.6529, P = 0.0001513, GC = 46
fd sdfsdfsdfsdf
fsdfdsfdfdfdfdfdf
dfdfdfdfedfsdfsdfdsf
dfdfdfsdfsdfsdfsdfdsf
sdfdsfdfdfdfdsfdfdfdfd
>gi|54367|ref|
fd sdfsdfsdfsdf
fsdfdsfdfdfdfdfdf
dfdfdfdfedfsdfsdfdsf
dfdfdfsdfsdfsdfsdfdsf
sdfdsfdfdfdfdsfdfdfdfd
Query = 1 - 65, Target = 6780 - 6812
Score = 8.13, E = 0.7692, P = 0.0001782, GC = 36
//
................EOF................................
The desired output EXCEL table will the contain the headers and data in the following order:
Serial Query start Query End target start target end Score E P GC
>gi|1234|ref| 1 65 1677 1733 8.38 0.6529 0.000151 46
>gi|54367|ref| 1 65 6780 6812 8.13 0.7692 0.000178 36
I have to iteratively perform this conversion in several (1000+ ) .txt files.
awk '/gi/ {print ;}'
awk '/Query/{print $3,$5,$8,$10;}'
awk '/Score/ {print $3, $6, $9, $12;}'
I was trying with the preliminary awk one-liners and trying to use "CAT" for concatenating all 3 .xls output which did not fulfiling the purpose.
I need urgent help!!!!!!!!!, looking forward for your responses (new script/ modified version of the one-liners).
P.S: Input file and output file is attached for more clarity.
Best regards,
Amit