Wednesday 27 June 2018

How can I import a CSV file into an SQLite table that doesn't allow null values?


I've been using the SQLite Manager extension for Firefox to edit my Chrome web data file in order to restore my keyword searches, and I think I have everything in place except that when I import a CSV file into a table,



  • it won't import into the actual table because the table doesn't allow null values

  • if I import it into a new table that does allow null values, then all the empty strings end up as null and I have to manually edit the row, type and delete a character, and then it's set to empty string and it's fine


So: is there either a way to import the CSV so that empty cells are automatically turned into empty strings instead of null, OR is there a way once a table is imported that has null values to convert it into one that doesn't allow null values, where each formerly null value is the empty string?


Thanks!



Answer



If the values that are null are all strings, how about search/replacing all ocurrences of ;; with ;""; in the csv file ?


No comments:

Post a Comment

Where does Skype save my contact's avatars in Linux?

I'm using Skype on Linux. Where can I find images cached by skype of my contact's avatars? Answer I wanted to get those Skype avat...