New answers tagged csv-file
That's because of the set linesize 1000 clause. That one is making all your lines in the spool file to be 1000 rows long, even if there is no such data. Try this from a clean SQL sqlplus session: set linesize 1000 spool test.txt select * from dual; spool off exit Then, go back to shell and open the test.txt with any text editor, move to the lines ...
See the mydata.csv file at bottom of the answer. I created a table xy CREATE TABLE `xy` ( `fred` int(11) DEFAULT NULL, `mary` int(11) DEFAULT NULL, `billy` varchar(50) DEFAULT NULL ); From the documentation here, I tried this LOAD DATA INFILE 'mydata.txt' INTO TABLE tbl_name FIELDS TERMINATED BY ',' ENCLOSED BY '"' LINES TERMINATED BY '\r\n' ...
The documentation page you linked to is for the current version (3.8.9) of SQLite. You could dig up the old version of cli.html for 3.7.13, but at that time, .import was pretty much undocumented.
Errors occured because of unescaped backshlashes. Values preceeded with \ were inrepereted as ascii signs, but they weren't. To avoid this error backslash - \ should be escaped by additional backslash - \ so occurences of backslashes should be changed to double backslashes - \\ .
Top 50 recent answers are included