0

Sorry if this is a basic question, I don't use linux often but I have a 13GB file that I want to filter down.

I have 123 columns and I want to remove rows that have only a . in the 75th column.

I've been looking into how to do this, at the moment I've got:

awk '$75 !~/./ {print $0}' oldfile.txt > newfile.txt

Am I along the right lines? When I run this it outputs an empty file.

1 Answer 1

1

try

awk '$75 != "." ' oldfile.txt > newfile.txt

this will match 75 th column for an extact dot.

what you did

awk '$75 !~/./ {print $0}'

will try to match 75th column for something different from any char (regexp match by . )

more precisely

awk '$75 ~ /./ ' 

will match any row where 75th columen have at least one char (which is all row, if you have more than 75 columns)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .