Awk to skip the blank lines
There are two approaches you can try to filter out lines: awk ‘NF’ data.txt and awk ‘length’ data.txt Just put these at the start of your command, i.e., awk -v variable=$bashvariable ‘NF { print variable … }’ myinfile or awk -v variable=$bashvariable ‘length { print variable … }’ myinfile Both of these act as gatekeepers/if-statements. … Read more