validate csv file load

Hi All,

I am using sqlldr to load my csv files into the database. The code in the sh script is as follows.

sqlldr ${DBUSER}/${DBPASS}@${ORACLE_SID} \
data=myCSV.data \
bad=myCSV.bad \
control=myCSV.ctl \
log=myCSV.log > /dev/null 2>&1

Now, the log file has some lines at the end which state the following:

Total logical records read: 30
Total logical records rejected: 1

This does not indicate why the record was rejected.

Now I want to validate the csv files, either before load or during load. During load would be better as i can add code in the same loader sh script.

The validation should be as follows:
1) Check for premature EOF in the input csv file.
2) Check for the number of fields for all records in the csv file.
3) Check for Not Null validations in the csv file.
4) Check for datatype violations in the csv file according to the database table column definitions.

This way I can find the reason for the records not being loaded.

If you guyz have faced such a scenario, do let me know your inputs.

Thanks in advance,
Rahul.