I am trying to go through a file that has a few million lines. I want to only pull lines that contain a number anywhere in the ninth field, but it has to be after a "/" character. Here is my awk:
This should work. No need print, since print $0 is default action.
awk -F\| '$9 ~ /\/.*[0-9]+/' file1 > file2
The * here \/* makes / optional. 0 or more hits. Remove this.
Same here: [0-9]{1,}*. Replace with + (1 or more number) {1,} this does not work if you do not have --posix option. awk --posix code . At lest for my version.
That makes a lot more sense. I was wondering why it was just grabbing everything. I totally forgot that the "asterisk" matched 0 or more references and that I needed to add the "dot".
Thanks so much. Sometimes you just need a second set of eyes.