I've worked with data for the whole of my programming life. If it's not dbf, mdb, ldf its those annoying Excel spreadsheets people love to send you and just "import" with all the dodgy quotes and pipes etc
I was used to opening the file low-level and reading the file line-by-line, splitting up the fields as we go and inserting the data into the database. However, people love to put quotes, commas and any combination of quote-comma-quote actually in to the text. Fine if you're a human, as it makes the reading of the text much easier and feature-filled ; Nightmare if you're a computer as those just look like new fields leaving you with more or less fields than the last record
Those clever guys at Microsoft have done it again with OleDb. Ever wondered how Excel knows how to delimt the fields properly, given a really poor system of data entry? I have wondered this for years, putting it down to sheer magic, and the magic really works!!
http://ronaldlemmen.blogspot.com/2008/03/import-csv-file-to-datatable.html has detailed instructions on how to get a CSV file and translate that directly into a DataTable. DataTables are one of the most logical structures i've used and that format suits me fine
Shazzam!!
Currently rated 4.5 by 2 people
- Currently 4.5/5 Stars.
- 1
- 2
- 3
- 4
- 5