Ok..with this i/p file, your awk script will never create the file as it will always return something for fd1..
what sould be the content of the reject file..? How do you identify a line that is an error?
Oops, I had posted one record with blank value for first field. Not sure, how it appeared different when I submitted the contents
Well, let me try it in different way. Below are the contents of the file.
Line 1: A123456 11111
Line 2: B123456 22222
Line 3: C123456 33333
Line 4: 44444
Line 5: D123456 55555
In above example, line 4 does not contain contents for fld1 and hence should be written to Reject file. Does this help?