You're using tab-deliminated files, so try
awk -F '\t' '$9 ~ /20[0,6]/' test.txt
instead.
Sorry for bumping.
]]>Thanks for the assistance. Will mark as solved.
...actually, my original thought was flawed. I actually need to preform this grep query within column #9 in the text file. Simply doing it on a line-by-line basis does not catch the errors. I need to some how mate this up with awk.
EDIT: Here is a sample of the file: http://repo-ck.com/PKG_source/test.txt
Try
awk '$9 ~ /20[0,6]/' test.txt
The sample has only 200 in the 9th column, but I edited it and it worked with 206 too.
]]>graysky, do both conditions have to be met at the same time? Is it 1) AND 2) or 1) OR 2)?
Is it an or: either 200 or 206 (it will never be both). I edited post #4 with a sample file.
]]>...actually, my original thought was flawed. I actually need to preform this grep query within column #9 in the text file. Simply doing it on a line-by-line basis does not catch the errors. I need to some how mate this up with awk.
EDIT: Here is a sample of the file: http://repo-ck.com/PKG_source/test.txt
]]>grep -E '(\t200\t)|(\t206\t)' parsed.log
Edit: Wait, that matches a literal 't', doesn't it?
I think you need this:
grep -P '[\t]200[\t]|[\t]206[\t]' parsed.log
1) <TAB>200<TAB>
2) <TAB>206<TAB>
Where <TAB> is a literal tab as my other stuff reads tab deliminated files. The following grep works to match simply '200' or '206' but I can't get the grep syntax correct to match with the trailing and leading tabs.
grep -w '200\|206' parsed.log
Any help is appreciated.
EDIT: Finally!
grep -E $'\t200\t\|\t206\t' parsed.log
EDIT2: Rrrr... the above works under zsh but not under bash... what's my problem?
]]>