Checking the required columns in File

Hello Experts,

File contains 10 columns with | delimeter. 1,3,4,5,7,9 columns are required columns means it should contains values.
i need those records, rest of it will contain or not contain data.

test1.txt:

a@a.com|a|b|c|d|e|f|g|h|i
|a|b|c|d|e|f|g|h|i
b@b.com|a||c|d|e|f|g|h|i
b@b.com|a||c|d|e|f|g||i

output:

a@a.com|a|b|c|d|e|f|g|h|i
|a|b|c|d|e|f|g|h|i

Please help me unix command

Thanks,
Murali

nawk -F\| '$1~/./ && $3~/./ && $5~/./ && $7~/./ && $9~/./' inputfile

Thanks for your great help...

---------- Post updated at 02:28 AM ---------- Previous update was at 02:19 AM ----------

And also ,i want check the exact 10 columns,it is exceded no need to process.

nawk -F\| 'NF==10 && $1~/./ && $3~/./ && $5~/./ && $7~/./ && $9~/./' inputfile

it's woking Lot of thanks...

---------- Post updated at 06:51 AM ---------- Previous update was at 03:14 AM ----------

IF i use the same command,we will get the output. Using the ksh script how to load data into another file...

Do you mean how to put the output into a file? Just redirect it:

nawk -F\| 'NF==10 && $1~/./ && $3~/./ && $5~/./ && $7~/./ && $9~/./' inputfile > outputfile

I want create the test.ksh file using the above command and store the output file into another file.

---------- Post updated at 07:14 AM ---------- Previous update was at 07:01 AM ----------

Please help me how to do....

---------- Post updated at 07:47 AM ---------- Previous update was at 07:14 AM ----------

Any updates?

---------- Post updated at 09:48 AM ---------- Previous update was at 07:47 AM ----------

Please help me ,how to write script.

Please, stop bumping up posts - it's against the Rules.
Just put any one of the solutions in test.ksh, make it executable chmod +x test.ksh and run it as test.ksh > outputFile .