I am a beginner with using linux bash for bioinformatics purpose and recently i encountered some error with this 'awk' command. ChatGPT suggestion is not helping and the task is very basic. I have a big file of human genome and i need to extract CDS region. This is one of the examples from the file:" CDS 648..2924"Screenshot from the file start position is first number, end position is second number. my code:
awk '/CDS/ && /\.\./ { if (match($0, /([0-9]+)\.\.([0-9]+)/, arr)) { print arr[1], arr[2] } }' BRCA1.gb
Every suggestion is appreciated
Note: I know that there are other ways around to complete this task, but i need to complete it specifically with 'awk' and 'match'. Thanks a lot! (Picture from the file below)
awk 'match($0, /CDS.*\<([0-9]+)\.\.([0-9]+)/, arr) { print arr[1], arr[2] }' BRCA1.gb