mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1816 Observed data: In parser, split header on cellseparator, not tab
This commit is contained in:
parent
e26d978da4
commit
9d56cee1be
@ -170,7 +170,7 @@ std::vector<RimAsciiDataCurve*> RicPasteAsciiDataToSummaryPlotFeature::parseCurv
|
||||
// No header row found
|
||||
if (header.isEmpty()) return curves;
|
||||
|
||||
QStringList columnHeaders = header.split('\t');
|
||||
QStringList columnHeaders = header.split(settings.cellSeparator());
|
||||
|
||||
for (int i = 1; i < columnHeaders.size(); ++i)
|
||||
{
|
||||
|
@ -63,27 +63,26 @@ void RifColumnBasedAsciiParser::parseData(QString& data, QString dateFormat, QLo
|
||||
{
|
||||
QTextStream tableData(&data);
|
||||
|
||||
QString header;
|
||||
|
||||
do {
|
||||
header = tableData.readLine();
|
||||
} while (header.isEmpty() && !tableData.atEnd());
|
||||
|
||||
// No header row found
|
||||
if (header.isEmpty()) return;
|
||||
|
||||
QStringList columnHeaders = header.split(cellSeparator);
|
||||
|
||||
for (int i = 1; i < columnHeaders.size(); ++i)
|
||||
{
|
||||
QString header;
|
||||
|
||||
do {
|
||||
header = tableData.readLine();
|
||||
} while (header.isEmpty() && !tableData.atEnd());
|
||||
|
||||
// No header row found
|
||||
if (header.isEmpty()) return;
|
||||
|
||||
QStringList columnHeaders = header.split('\t');
|
||||
|
||||
for (int i = 1; i < columnHeaders.size(); ++i)
|
||||
{
|
||||
m_data.m_headers.push_back(columnHeaders[i]);
|
||||
}
|
||||
|
||||
// No columns found
|
||||
if (m_data.m_headers.empty()) return;
|
||||
m_data.m_headers.push_back(columnHeaders[i]);
|
||||
}
|
||||
|
||||
// No columns found
|
||||
if (m_data.m_headers.empty()) return;
|
||||
|
||||
|
||||
int numColumns = static_cast<int>(m_data.m_headers.size());
|
||||
|
||||
m_data.m_values.resize(numColumns);
|
||||
|
Loading…
Reference in New Issue
Block a user