checking csv files with empty fields..!

Hi! I need to learn that how a shell script can transverse a csv file n check if any field is empty or not. means its contains two comma or space b/w commas i.e., "" or " ".
can anyone help me out how I can do that....

input.txt:

a,b,,d,e
1,2, ,4,5
p,q,r,s,t
$ perl -ne 'print "$_" if (/,,|, ,/)' input.txt
a,b,,d,e
1,2, ,4,5

Is this what you're looking for?

thanks @balajesuri m looking something like dat. i dnt knw much scripting ..but perl i have never used. here m trying to clear my scenario..hope you will understand.

Scenario:
Suppose many *.csv files are in a directory.
Script has to go through all the csv files n check if all the field contains some value. i.e., they are not NULL. like two commas are not coming together. i.e., ",," or ", ,".
then script print the corresponding names on screen which csv files having empty field.

its a bit difficult task for a newbie like me.
thanks

for x in *.csv; do egrep -q ",,|, ," $x; [ $? -eq 0 ] && echo "$x has an empty field"; done
grep -l ",[ ]*," *.csv

man grep

HTH
--ahamed

In nawk ..

$ nawk '$0~/(,,|, ,)/{print FILENAME" NULL FIELDS"|"sort -u"}' *.csv

@ahamed101: :b:

thanks alot guys for your help.....
if in case i wanna change comma(,) with pipe(|) can i do that...will unix allow to do that?? means if in csv files instead of comma i'm gonna receive pipe??

You'll have to escape it. Something like this: "\|[ ]*\|"

@balajesuri thanks again its working!!