Hi Joakim,
When reading line by line from a text (csv) file rows are cut in half and sometimes skipped all together. |
I've notified our developers about the file reading issue, and they will look into it. Thanks for letting us know!
Im adding all data in this file to a double dimension array to compare it with a DBTable object.
There might be a smarter way? |
You can create a database checkpoint for your CSV file, or you can bind an existing DBTable object to the CSV file at run time. Then, you'll be able to perform the comparison using just a couple of lines of code:
// Bind an existing DBTable to the CSV file
// DBTables.table_name.ConnectionString = 'Provider=Microsoft.Jet.OLEDB.4.0;Data Source=C:\CSVFileFolder\;Extended Properties="text;HDR=Yes;FMT=Delimited"';
DBTables.table_name.Check();
Notes:
* Check out
http://connectionstrings.com/textfile for connection strings for CSV files.
* "|" is a non-standard separator, so you'll need to create the
Schema.ini file for your CSV file with the following contents:
[test.csv]
Format=Delimited(|)
* If you choose to rebind an existing DBTable object to your CSV file at run time, the file must have the same name as DBTable's original table. For example, if the DBTable object was originally created for the
Orders table, the file must be named
Orders.csv.