I have a data like this
JW_ID ECK number B number T Number M K12 Conc(%) Yield(uM) Yield(ug/ml)
JW0002 ECK0003 b0003 thrB thrB 32 2.3 78
JW0003 ECK0004 b0004 thrC thrC 18 1.7 78
JW0004 ECK0005 b0005 yaaX yaaX 78 1.2 14
JW0005 ECK0006 b0006 yaaA yaaA 7 2.4 71
JW0007 ECK0008 b0008 talB talB 85 2.7 94
I am trying to remove two columns and B Number and M K12 then sort the file by ascending based on Conc(%) Yield(uM) Yield(ug/ml)
I run it as
bash myprogram.sh filename.txt
I have tried to make a bash but no success, I would appreciate any help
#!/bin/bash
filename=$1
while read -r line; do
# reading each line
awk '{$3=$5=""; print $0}' filename
sort -k6,1 -k7,2 -k8,3 filename
echo $line
done < $filename
the expected output is like this
JW_ID ECK number T Number Conc(%) Yield(uM) Yield(ug/ml)
JW0005 ECK0006. yaaA 7 2.4 71
JW0003 ECK0004. thrC 18 1.7 78
JW0002 ECK0003 thrB 32 2.3 78
JW0004 ECK0005. yaaX 78 1.2 14
JW0007 ECK0008 talB 85 2.7 94
<infile cut -f1,2,4,6- |sort -t $'\t' -k4,6n
? if yes, I will answer it