Mercurial > hg > svcore
diff data/fileio/CSVFormat.cpp @ 1599:ce185d4dd408 bqaudiostream
Merge from default branch
author | Chris Cannam |
---|---|
date | Wed, 23 Jan 2019 14:43:43 +0000 |
parents | 9570ef94eaa3 |
children | bde22957545e |
line wrap: on
line diff
--- a/data/fileio/CSVFormat.cpp Wed Jan 23 10:31:40 2019 +0000 +++ b/data/fileio/CSVFormat.cpp Wed Jan 23 14:43:43 2019 +0000 @@ -39,8 +39,6 @@ bool CSVFormat::guessFormatFor(QString path) { - m_separator = ""; // to prompt guessing for it - m_modelType = TwoDimensionalModel; m_timingType = ExplicitTiming; m_timeUnits = TimeSeconds; @@ -108,14 +106,12 @@ for (int i = 0; i < candidates.length(); ++i) { auto bits = StringBits::split(line, candidates[i], m_allowQuoting); if (bits.size() >= 2) { - SVDEBUG << "Successfully split the line into:" << endl; - for (auto b: bits) { - SVDEBUG << b << endl; + m_plausibleSeparators.insert(candidates[i]); + if (m_separator == "") { + m_separator = candidates[i]; + SVDEBUG << "Estimated column separator: '" << m_separator + << "'" << endl; } - m_separator = candidates[i]; - SVDEBUG << "Estimated column separator: '" << m_separator - << "'" << endl; - return; } } } @@ -123,9 +119,7 @@ void CSVFormat::guessQualities(QString line, int lineno) { - if (m_separator == "") { - guessSeparator(line); - } + guessSeparator(line); QStringList list = StringBits::split(line, getSeparator(), m_allowQuoting);