awk search column, print line

Hello.

I've been banging my head against walls trying to search a comma delimited file, using awk. I'm trying to search a "column" for a specific parameter, if it matches, then I'd like to print the whole line.

I've read in multiple texts:

awk -F, '{ if ($4 == "string") print $0 }' filename
OR
awk -F, '{ $4 == "string" }' filename

And nothing seems to work? What am I doing wrong?

Info:
OS - Ubuntu 9.10, using bash

BTW, this is my first post on these forums, please forgive any misused etc. etc.. I've been using these forums heavily to learn how to shell script etc.. This is an amazing community, us n00bs are lucky to have something like this. Thank you all so much.

If my question has been answered in another post (which I believe it has, but it didn't work see Can I search columns and print lines? )... please forgive me.

Thanks again

If you are literally searching for the word "string" this should work fine. But
VAL=string
awk -F, '{ if ($4 == "$VAL") print $0 }' filename

would not work. Are you actually trying something like that? Post your actual code and a sample of your data.

6 mins later I had a reply? Wow! Thanks!

As for my problem... I figured it out.

Sorry, I have no code yet to past, as this was one of the first step to start the process. Should I have asked this question in another forum? I had "script" on the brain.

FWIW:
I need to "ensure" that the comma delimited file I'm working w/, is 100% accurate w/ the data that I'm grabbing from it and massaging. That said, it's a 60,000+ file, and I have to break the rows up by year/period. It has to be perfect. This was my solution:

awk -F, '{ if ( $1 == "\"200301\"" ) print $0 }' <filename>

(egrep -v '"200301"' <filename> worked... but it if that patterned showed up in another column I was screwed)

Sorry for the weak post, I was so frustrated at this last yesterday, I actually stopped lurking on the boards.

Thanks again