when load data local infile, data truncated @ beginning of rows, tried lines terminated '/r/n', '/r' , '/n' loaded 1 row in table..
mytable 1 column, , myfile.txt has 1 column delimited new line character @ end of each line..
any suggestions welcome !
## here example of data have load ensg00000000003.10 ensg00000000005.5 ensg00000000419.8 ensg00000000457.8 ensg00000000460.12 ensg00000000938.8 ensg00000000971.11 ensg00000001036.8 mysql> load data local infile "c:/myfile.txt" table mytable; query ok, 57281 rows affected (0.73 sec) records: 57281 deleted: 0 skipped: 0 warnings: 0 mysql> select * mytable limit 5; +---------------------+ | ensembl | +---------------------+ |ensg00000000003.10 |nsg00000000005.5 |nsg00000000419.8 |nsg00000000457.8 |ensg00000000460.12 +---------------------+
i had problem too, ended writing mini-parser few "testlines" before load each file.
public static void findterminator(file file) throws filenotfoundexception { bufferedreader lines = new bufferedreader(new filereader(file)); int countlines = 0; int testlines = 15; int c; int[] terminators = { 0x0a, 0x0d, 0x0d0a }; //\n, \r, \r\n int[] counters = { 0, 0, 0 }; try { while (((c = lines.read()) != -1) && (countlines <= testlines)) { (int d = 0; d < terminators.length; d++) { if (c == terminators[d]) { counters[d]++; countlines++; } } } } catch (ioexception e) { e.printstacktrace(); } int max = 0; int maxindex = 0; (int = 0; < counters.length; i++) { if (max < counters[i]) { max = counters[i]; maxindex = i; } } terminator = (char)terminators[maxindex]; system.out.println("terminator: '" + terminators[maxindex] + "'"); }