Entering edit mode
2.4 years ago
sunnykevin97
▴
990
Hello every one,
I'd like to parse the output into a nice tabular form.
Original file -
Head -n 15 out.txt
OG0017773
lnL(ntime: 17 np: 21): -308.613954 +0.000000
kappa (ts/tv) = 1.19167
tree length = 1.00231
\n
OG0017774
lnL(ntime: 17 np: 21): -1176.541361 +0.000000
kappa (ts/tv) = 1.81927
tree length = 0.14755
\n
Expected output -
ID lnL kappa tree-length
OG0017773 -308.613954 1.19167 1.00231
OG0017774 -1176.541361 1.81927 0.14755
Suggestions appreciated.
Only 1- 679 rows were in proper format. others were not (see below).
Well, evidently the lines are shifted, possibly by additional or fewer whitespaces in those lines (either in the sample names or due to the tool's output). You could try to collapse them:
So give this a spin:
Ultimately, you unfortunately need to troubleshoot this yourself based on the data:
[:space:]
instead of[:blank:]
$14
instead of$15
if you wish to print the fourteenth instead of fifteenth column.