10
My CSV import script crashed 200 rows in, twice
Tried to import a client's data dump into a MySQL table on Tuesday and hit a wall at row 214 both times. Turned out the file had a stray comma inside one of the address fields, something I didn't see until I opened it in Notepad++. I wrote a quick Python script to fix it, but then I realized my regex was also catching the phone numbers. Has anyone else had similar trouble with messy CSV files from older systems?
1 comments
Log in to join the discussion
Log In1 Comment
luna_jackson2828d ago
The regex catching phone numbers is the kind of thing that makes you want to throw the computer out the window. I've been there with old export files from some legacy CRM, where the data was basically held together with tape and hope. It's always something dumb like a stray comma or a quote that wasn't escaped, and you only see it after the script blows up for the second time. The fact that you caught it in Notepad++ before going back in is a win though, most people would've just tried the same import again and gotten the same crash. Honestly, I feel for you, this kind of debugging eats up a whole afternoon and leaves you questioning every line of your own code.
7