awk - read from a file and write conditional output

I have a file, which has '|' as separator; I need to read each line from that file and produce output to another file. While reading, I have certain condition on few specific columns (like column3 ='good'); only those lines will be processed.

awk is a good tool to work with individual fields, as in your case.
Please see below:

 $ cat aa
field 1a| field 2a| good | field 4a
field 1b| field 2b| bad  | field 4b
field 1c| field 2c| good | field 4c

 $ awk -F'|' '{ if($3 ~ "good"){print $0;} }' aa
field 1a| field 2a| good | field 4a
field 1c| field 2c| good | field 4c
 

If you are not familiar with awk, here are few hints so you can make it work for your specifics. the -F '|' tells awk to use pipe as field delimiter, the $3 is third field, the $0 is whole line

hope it helps.

Thanks. I got the basics. Now here is detailed scenario.
I would like to read each line and then compare multiple columns with ceratin values and then print specific columns to a file or variable.
Here's what I tried to do but got syntax error

awk '{
if (($3=="3" && $18=="Y") || ($3=="3" && $14=="ELIGIBLE FOR LIFESCAN ONLY"))
    print $1$5$3$6
}' mdm8624CARSd.199065

So, if column3 is 3 and column 18 is Y; OR column3 is 3 and column 14 is FILE; the print columns 1, 5, 3 and 6 to an output file or variable.
The input file do have '|' as field separator.

It's always good to have representative sample input (and output) data, as well as complete error msgs. What error do you get where and when? To me, what you post could be simplified to

awk     '($3=="3" && ($18=="Y" || $14=="ELIGIBLE FOR LIFESCAN ONLY")) {print $1 $5 $3 $6}
        ' FS="|" mdm8624CARSd.199065

and should not get any syntactical error. Don't forget to assign the field separator!