Hello all;
I have a large file (csv file) with addresses. I am trying to filter out specific entries based on zip code from a particular column of data. However my awk statement can not account for zipcode that begins with a certain pattern. It finds the pattern anywhere within the zipcode. Zipcodes have been entered either using the 5 digit method or 9 digit method (no hypen). I have tried the ^ option but it does not seem to work.
Here is my example that works but needs editing:
awk -F"," '($25 ~ /[1][2][3][0-9][0-9]/)' infile > outfile
have tried
awk -F"," '($25 ~ /^[1][2][3][0-9][0-9]/)' infile > outfile ' doesn't work
Any suggestions would be greatly appreciated.
nelson