Sunday, January 9, 2011

How to fix CSV data file

New functionality in Flat File Checker allows very intuitive and quick way to correct data in the text file (csv, etc.).
To correct data in a file you can set up validation rules in Flat File Checker and run validation (see how to set up validation of CSV file in previous post). 

Then you can open data preview form by clicking on Preview in pop-up menu item of the the file:

Figure 1. Right click on the file and select Preview
This will open the Data Preview form that shows records from the source file with erroneous records being highlighted:
Figure 2. Form shows source file.
Now you can edit the values in the table to correct the source file. When you change values in the cells "Apply Changes" button becomes active:

Figure 3. Apply Changes button becomes active if values were changed
 When you click on this button changes are save to the source file:
Figure 4. Changes were applied to the source file
Now you can re-run you schema and check whether previously erroneous values are still highlighted in the data preview form. 

You can also delete records from the file by right-clicking on the corresponding records and selecting "Delete Record":

Figure 5. Delete record from the source file.
Record selected for deletion will be crossed out in the table and will be permanently deleted from the source file if "Apply Changes" button is clicked:

Figure 6. Record will be deleted from the source file if
"Apply Changes" button is clicked.