1

Using awk on my data I have this result:

Command:

$ awk '{split($8,INFO,";"); print $1"\t"$2"\t"INFO[8]}' data.txt

Result:

chr1 1115252246 VMF=0.0426

chr1 115256495 VMF=0.0574

chr1 115256536 VMF=0.0465

chr1 115256579 VMF=0.0574

I'd like to remove the "VMF=" string from my third column using the same AWK code and have it:

chr1 115252246 0.0426

chr1 115256495 0.0574

chr1 115256536 0.0465

chr1 115256579 0.0574

Thank you!

1
  • Good that you have posted the code which you are trying, please do add the sample of input and expected output too for better understanding of your question too each time. Commented Aug 7, 2018 at 15:00

1 Answer 1

2

Add sub(/VMF=/,"",INFO[8]); between the split and the print.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.