skip to main content
Using the driver : CSV files : Discard file
  

Try DataDirect Drivers Now

Discard file

If the driver was unable to load rows into the database for a bulk load operation from a CSV file, it can record all the rows that were not loaded in a discard file. The contents of the discard file is in the same format as that of the CSV file. After fixing reported issues in the discard file, the bulk load can be reissued, using the discard file as the CSV file.
A discard file is created by specifying a file name and location for the discard file using the setDiscardFile method.
Creating a discard file on Windows
To create a discard file named discard.csv located in the C:\temp directory, you would specify:
bulkLoad.setDiscardFile(C:\\temp\\discard.csv)
Note: If coding a path on Windows to the log file in a Java string, the backslash character (\) must be preceded by the Java escape character, a backslash. For example: C:\\temp\\discard.csv.
Creating a discard file on UNIX/Linux
To create a discard file named discard.csv located in the /tmp directory, you would specify:
bulkLoad.setDiscardFile(/tmp/discard.csv)