mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 11:00:44 -06:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user