The problem with copy data from e.g., an excel or calc sheet into an SQLite database (or any database I reckon) is that the data you copy might include an carriage return. I found this out the hard way after having copied data from a spreadsheet into a attribute table of a GRASS GIS vector layer (which is stored in a SQLite database). When later I opened the table with the Attribute table manager in GRASS GIS, I got a lot of error messages like the one in the screenshot below:
Going to the mentioned records (253 in this case) I found out that they all contained carriage returns in the just updated fields. A bit of googling learned that it is easy enough to select all records with carriage returns; you just include a carriage return in your code, e.g.:
SELECT * FROM table WHERE column LIKE '% %'
Knowing this, it is easy to clean up your table by replacing the values. The probably easiest way is with the UPDATE function:
UPDATE table SET column=REPLACE(column,' ', '')
I didn’t try to do this on the command line, but you probably need to use the hexadecimal representations of the carriage return, something in the line of:
I tried to use the hex notation instead of an actual carriage return in my SQLite manager, but it didn’t work. So if you know how to use the hex code, let me know.