file formating in Perl

Hi,
I am new to unix , I have a requirement for formating the input file and generate the output file as per the downstream requirement ..
My application receiving a text input file having 4 field and my application need to check each field and if some value of a field is blank ..then it need to add some text and create a output file for this .
Input records fields: (name,age,CUID,ZIP)

jim,23,49089,56098
sue,45,,870089
mike,52,89387,89076

output file:
jim 23 49089 56098
sue 45 NO 870089
mike 52 89387 89076

It checking each fields value , the CUID field values for sue is blank.so it add "NO" then generates the output with some fixed filed size length.

Please help me regarding this .

Thanks in advance .

If you are intending to use perl, you could probably use the split() function to split the lines on the commas and check each field for valid data, if none is there, add "NO" or whatever. I say "probably" because you have not describe the situation very well.