Welcome to Software Development on Codidact!
Will you help us build our independent community of developers helping developers? We're small and trying to grow. We welcome questions about all aspects of software development, from design to code to QA and more. Got questions? Got answers? Got code you'd like someone to review? Please join us.
Post History
You're matching the regex pattern of /-/, so it just matches every individual hyphen, regardless of where. You want to match the entire entry if it's only hyphens, or /^-+$/. ^ – Beginning of line...
Answer
#1: Initial revision
You're matching the regex pattern of `/-/`, so it just matches every individual hyphen, regardless of where. You want to match the entire entry if it's only hyphens, or `/^-+$/`. `^` – Beginning of line `-+` – One or more hyphens `$` – End of line Putting that in gives `awk 'BEGIN{FS=OFS="\t"}{gsub(/^-+$/,"",$72)}1' file.tsv` which does what you want.