Well maybe this is not the best title; but it's hard to convey my intention only in short title.
I've a line here:
2 118610455 P2_PM_2_5034 T <DUP:TANDEM> 40 . END=118610566;SVLEN=110;SVTYPE=TDUP;CIPOS=-100,55;CIEND=-56,100;IMPRECISE;DBVARID=esv7540;VALIDATED;VALMETHOD=CGH;SVMETHOD=RP
Basically I would like to convert it into:
2 118610455 118610566
So major problem is to grep this 118610566 from the 8th column.
I know how to grep this number:
$c=`cat line|awk '{print $8}'|sed 's/;/\t/g'|awk '{print $1}'|sed 's/\END=//g'`
but my question is then how I can incorporate this variable into another bash line:
what_i_want=`cat line|awk '{print $1"\t"$2"\t"$c}'`
thx