Fixed a problem with the csv-import.

During the import, the parser used to append blanks between quotes and separators as part of the cell-content.
Now blanks are detected and ignored, iff they are not used as separator or in between quotes.
This commit is contained in:
moritzhader
2014-07-09 20:29:11 +02:00
parent e86e648124
commit 37e195ad6f

View File

@@ -898,16 +898,18 @@ QStringList DBBrowserDB::decodeCSV(const QString & csvfilename, char sep, char q
result << current;
current = "";
}
} else if (c==10) {
} else if (c==10 || c==13) {
if (inquotemode){
//add the newline
current.append(c);
}
} else if (c==13) {
if (inquotemode){
//add the carrier return if in quote mode only
//add the newline/carrier return
current.append(c);
}
} else if (c==32) {
// Only append blanks if we are inside of quotes
if (inquotemode) {
current.append(c);
}
} else {//another character type
current.append(c);
}