How to remove symbols from a column using awk
Using gsub
:
awk '{gsub(/\"|\;/,"")}1' file
chr1 134901 139379 - ENSG00000237683.5
chr1 860260 879955 + ENSG00000187634.6
chr1 861264 866445 - ENSG00000268179.1
chr1 879584 894689 - ENSG00000188976.6
chr1 895967 901095 + ENSG00000187961.9
If you want to operate only on the fifth field and preserve any quotes or semicolons in other fields:
awk '{gsub(/\"|\;/,"",$5)}1' file
If your data is formatted exactly as shown (i.e. no other "
or ;
in other columns that need to be preserved), then you can simply use tr
to remove these characters:
tr -d '";' < input.txt > output.txt
Using sed to remove all instances of '";':
sed -i 's/[";]//g' file
To only remove from 5th column sed is probably not the best option.