I have a 33 GB file. In this file the first column is the country code (eg: AT, BE, CA, DE, DK, GB, IE, IT, etc). I'm using awk command like the below:
awk -F"|" '$1~/^AT/ {print $0}'
This command works fine. But it is taking nearly 1.5 hours as awk reads the entire file.
Is there a way to break the awk command when if it has finished searching for a pattern.
Example: When it finished searching for AT it should break searching the rest of the file.
The file I am using is sorted.
AT
match or after the lastAT
match ?