#2003 Observed Data : Add file parsing of fixed column width

This commit is contained in:
Magne Sjaastad
2017-11-03 12:01:09 +01:00
parent f844c6fdb9
commit 265c0ebb70
5 changed files with 608 additions and 15 deletions

View File

@@ -51,8 +51,9 @@ bool RifEclipseUserDataParserTools::isLineSkippable(const std::string& line)
return true;
}
if (line[0] == '1')
if (line[found] == '1' &&
line.find_first_not_of("1 ") == std::string::npos)
{
// Single 1 at start of file
@@ -60,7 +61,7 @@ bool RifEclipseUserDataParserTools::isLineSkippable(const std::string& line)
}
std::string str(line);
if (str.find("SUMMARY") < str.size())
{
return true;
@@ -70,11 +71,12 @@ bool RifEclipseUserDataParserTools::isLineSkippable(const std::string& line)
{
return true;
}
if (str.find("NULL") < str.size())
{
return true;
}
return false;
}
@@ -206,16 +208,25 @@ bool RifEclipseUserDataParserTools::keywordParser(const std::string& line, std::
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
void RifEclipseUserDataParserTools::splitLineToDoubles(const std::string& line, std::vector<double>& values)
std::vector<double> RifEclipseUserDataParserTools::splitLineToDoubles(const std::string& line)
{
std::istringstream iss(line);
values.clear();
double d;
while (iss >> d)
std::vector<double> values;
QString s = QString::fromStdString(line);
QStringList words = s.split(" ");
bool ok = false;
for (auto w : words)
{
values.push_back(d);
double val = w.toDouble(&ok);
if (ok)
{
values.push_back(val);
}
}
return values;
}
//--------------------------------------------------------------------------------------------------
@@ -505,3 +516,347 @@ TableData RifEclipseUserDataParserTools::tableDataFromText(std::stringstream& st
return TableData(origin, dateFormat, startDate, columnInfos);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifEclipseUserDataParserTools::isFixedWidthHeader(const std::string& lines)
{
std::stringstream streamData(lines);
std::vector<std::string> headerLines = RifEclipseUserDataParserTools::findValidHeaderLines(streamData);
if (headerLines.size() > 1)
{
std::vector<size_t> firstLine = RifEclipseUserDataParserTools::columnIndexForWords(headerLines[0]);
for (auto line : headerLines)
{
std::vector<size_t> columnIndicesForLine = RifEclipseUserDataParserTools::columnIndexForWords(line);
for (auto index : columnIndicesForLine)
{
if (std::find(firstLine.begin(), firstLine.end(), index) == firstLine.end())
{
return false;
}
}
}
return true;
}
return false;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifEclipseUserDataParserTools::hasCompleteDataForAllHeaderColumns(const std::string& lines)
{
std::stringstream streamData(lines);
bool headerDataComplete = true;
{
auto lines = RifEclipseUserDataParserTools::findValidHeaderLines(streamData);
if (lines.size() > 0)
{
size_t wordsFirstLine = lines[0].size();
for (auto line : lines)
{
if (wordsFirstLine != line.size())
{
headerDataComplete = false;
}
}
}
}
return headerDataComplete;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<ColumnInfo> RifEclipseUserDataParserTools::columnInfoForFixedColumnWidth(std::stringstream& streamData)
{
auto headerLines = RifEclipseUserDataParserTools::findValidHeaderLines(streamData);
auto columnHeaders = RifEclipseUserDataParserTools::splitIntoColumnHeaders(headerLines);
return RifEclipseUserDataParserTools::columnInfoFromColumnHeaders(columnHeaders);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::string> RifEclipseUserDataParserTools::findValidHeaderLines(std::stringstream& streamData)
{
std::vector<std::string> headerLines;
std::stringstream::pos_type posAtTableDataStart = streamData.tellg();
size_t columnCount = 0;
std::string line;
bool continueParsing = true;
while (continueParsing)
{
posAtTableDataStart = streamData.tellg();
if (!std::getline(streamData, line))
{
continueParsing = false;
}
else
{
if (!RifEclipseUserDataParserTools::isLineSkippable(line))
{
if (columnCount == 0)
{
// Fist line with valid header data defines the number of columns
auto words = RifEclipseUserDataParserTools::splitLineAndRemoveComments(line);
columnCount = words.size();
headerLines.push_back(line);
}
else
{
auto words = RifEclipseUserDataParserTools::splitLineAndRemoveComments(line);
std::vector<double> doubleValues = RifEclipseUserDataParserTools::splitLineToDoubles(line);
if (doubleValues.size() < columnCount &&
words.size() < columnCount)
{
// Consider a line with double values less than column count as a table header
headerLines.push_back(line);
}
else
{
continueParsing = false;
}
}
}
}
}
streamData.seekg(posAtTableDataStart);
return headerLines;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::vector<std::string>> RifEclipseUserDataParserTools::splitIntoColumnHeaders(const std::vector<std::string>& headerLines)
{
std::vector<std::vector<std::string>> headerLinesPerColumn;
if (headerLines.size() > 0)
{
std::vector<size_t> columnOffsets = RifEclipseUserDataParserTools::columnIndexForWords(headerLines[0]);
if (columnOffsets.size() > 0)
{
headerLinesPerColumn.resize(columnOffsets.size());
for (auto headerLine : headerLines)
{
for (size_t i = 0; i < columnOffsets.size(); i++)
{
size_t colStart = columnOffsets[i];
size_t columnWidth = std::string::npos;
if (i < columnOffsets.size() - 1)
{
columnWidth = columnOffsets[i + 1] - colStart;
}
else
{
if (headerLine.size() > colStart)
{
columnWidth = headerLine.size() - colStart;
}
}
std::string subString;
if (columnWidth != std::string::npos &&
colStart < headerLine.size() &&
colStart + columnWidth <= headerLine.size())
{
subString = headerLine.substr(colStart, columnWidth);
}
subString = trimString(subString);
headerLinesPerColumn[i].push_back(subString);
}
}
}
}
return headerLinesPerColumn;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<ColumnInfo> RifEclipseUserDataParserTools::columnInfoFromColumnHeaders(const std::vector<std::vector<std::string>>& columnData)
{
std::vector<ColumnInfo> table;
for (auto columnLines : columnData)
{
if (columnLines.size() == 0) continue;
std::string quantity = columnLines[0];
std::string unit;
size_t startIndex = 1;
if (columnLines.size() > 1 &&
isUnitText(columnLines[1]))
{
unit = columnLines[1];
startIndex = 2;
}
std::vector<std::string> restOfHeader;
for (size_t i = 2; i < columnLines.size(); i++)
{
restOfHeader.push_back(columnLines[i]);
}
RifEclipseSummaryAddress adr = RifEclipseUserDataKeywordTools::makeAndFillAddress(quantity, restOfHeader);
ColumnInfo columnInfo;
columnInfo.unitName = unit;
// if (hasDateUnit(unit) ||
// hasDateUnit(quantity))
// {
// columnInfo.isAVector = false;
// }
// else
// {
// columnInfo.isAVector = true;
// }
//columnInfo.origin = origin;
//columnInfo.dateFormatString = dateFormat;
//columnInfo.startDateString = startDate;
columnInfo.summaryAddress = adr;
table.push_back(columnInfo);
}
return table;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<size_t> RifEclipseUserDataParserTools::columnIndexForWords(const std::string& line)
{
std::vector<size_t> columnOffsets;
std::size_t offset = line.find_first_not_of(" ");
while (offset != std::string::npos)
{
columnOffsets.push_back(offset);
offset = line.find_first_of(" ", offset);
offset = line.find_first_not_of(" ", offset);
}
return columnOffsets;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::vector<std::vector<ColumnInfo>> RifEclipseUserDataParserTools::mergeEqualTimeSteps(const std::vector<std::vector<ColumnInfo>>& tables)
{
return tables;
/*
if (tables.size() < 2)
{
return tables;
}
const ColumnInfo* timeCi = nullptr;
for (const ColumnInfo& ci : tables[0])
{
if (!ci.isAVector)
{
timeCi = &ci;
break;
}
}
if (!timeCi)
{
return tables;
}
std::vector<std::vector<ColumnInfo>> largeTables;
{
std::vector<ColumnInfo> largeTable;
largeTable.push_back(*timeCi);
for (const auto& t : tables)
{
if (t.size() > 0 && t[0].itemCount() != timeCi->itemCount())
{
largeTables.push_back(t);
continue;
}
for (const auto& c : t)
{
if (c.isAVector &&
c.values.size() == timeCi->observationDateTimes.size())
{
largeTable.push_back(c);
}
}
}
largeTables.push_back(largeTable);
}
return largeTables;
*/
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
std::string RifEclipseUserDataParserTools::trimString(const std::string& s)
{
auto sCopy = s.substr(0, s.find_last_not_of(' ') + 1);
if (sCopy.size() > 0)
{
sCopy = sCopy.substr(sCopy.find_first_not_of(' '));
}
return sCopy;
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
bool RifEclipseUserDataParserTools::isUnitText(const std::string& word)
{
if (hasTimeUnit(word)) return true;
if (word.find("BARSA") != std::string::npos) return true;
if (word.find("SM3") != std::string::npos) return true;
if (word.find("RM3") != std::string::npos) return true;
return false;
}

View File

@@ -120,7 +120,7 @@ public:
static bool isAComment(const std::string& word);
static std::vector<std::string> splitLineAndRemoveComments(const std::string& line);
static RifEclipseSummaryAddress::SummaryVarCategory identifyCategory(const std::string& word);
static void splitLineToDoubles(const std::string& line, std::vector<double>& values);
static std::vector<double> splitLineToDoubles(const std::string& line);
static size_t findFirstNonEmptyEntryIndex(std::vector<std::string>& list);
static bool keywordParser(const std::string& line, std::string& origin, std::string& dateFormat, std::string& startDate);
static bool isANumber(const std::string& line);
@@ -133,4 +133,21 @@ public:
static bool isValidTableData(size_t columnCount, const std::string& line);
static TableData tableDataFromText(std::stringstream& data, std::vector<std::string>* errorText = nullptr);
// Fixed width functions
static bool isFixedWidthHeader(const std::string& lines);
static bool hasCompleteDataForAllHeaderColumns(const std::string& lines);
static std::vector<ColumnInfo> columnInfoForFixedColumnWidth(std::stringstream& streamData);
static std::vector<std::string> findValidHeaderLines(std::stringstream& streamData);
static std::vector<std::vector<std::string>> splitIntoColumnHeaders(const std::vector<std::string>& headerLines);
static std::vector<ColumnInfo> columnInfoFromColumnHeaders(const std::vector<std::vector<std::string>>& columnData);
static std::vector<size_t> columnIndexForWords(const std::string& line);
static std::vector<std::vector<ColumnInfo>> mergeEqualTimeSteps(const std::vector<std::vector<ColumnInfo>>& columns);
static bool isUnitText(const std::string& word);
private:
static std::string trimString(const std::string& s);
};

View File

@@ -32,7 +32,7 @@ ${CEE_CURRENT_LIST_DIR}ObservedDataParser-Test.cpp
${CEE_CURRENT_LIST_DIR}EclipseRftReader-Test.cpp
${CEE_CURRENT_LIST_DIR}RicExpressionParser-Test.cpp
${CEE_CURRENT_LIST_DIR}RiuSummaryVectorDescriptionMap-Test.cpp
${CEE_CURRENT_LIST_DIR}RifEclipseUserDataKeywordTools-Test.cpp
${CEE_CURRENT_LIST_DIR}FixedWidthDataParser-Test.cpp
)
if (RESINSIGHT_ENABLE_PROTOTYPE_FEATURE_FRACTURES)

View File

@@ -0,0 +1,222 @@
#include "gtest/gtest.h"
#include "RifEclipseUserDataParserTools.h"
#include "RifColumnBasedUserDataParser.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST(FixedWidthDataParser, BasicUsage)
{
QString data = R"(
1
-------------------------------------------------------------------------------------------------------------------------------
SUMMARY OF RUN NORNE_ATW2013_RFTPLT_V3 ECLIPSE 2016.2 DATESTAMP 13-DEC-2016
-------------------------------------------------------------------------------------------------------------------------------
DATE FGIRH FVPT FWPT FOPT FLPT FLPTH FGPT FOPTH FGPTH
SM3/DAY RM3 SM3 SM3 SM3 SM3 SM3 SM3 SM3
*10**3 *10**3 *10**3 *10**3 *10**3 *10**6 *10**3 *10**6
0 0 0 0 0 0 0 0 0
-------------------------------------------------------------------------------------------------------------------------------
6-NOV-1997 0 0 0 0 0 0 0 0 0
7-NOV-1997 0 5.749954 0.004548 4.379801 4.384350 4.347700 0.476000 4.347700 0.482595
8-NOV-1997 0 13.76883 0.010841 10.48852 10.49936 10.41106 1.139745 10.41106 1.155627
9-NOV-1997 0 19.38692 0.015243 14.76847 14.78372 14.65899 1.604722 14.65899 1.627147
)";
std::stringstream streamData;
streamData.str(data.toStdString());
std::vector<std::string> tableHeaderLines = RifEclipseUserDataParserTools::findValidHeaderLines(streamData);
EXPECT_EQ(4, tableHeaderLines.size());
{
std::string line;
std::getline(streamData, line);
std::string firstDataLine = "6-NOV-1997";
line.find_first_of(firstDataLine);
EXPECT_TRUE(line.find_first_of(firstDataLine) != std::string::npos);
}
auto colHeaders = RifEclipseUserDataParserTools::splitIntoColumnHeaders(tableHeaderLines);
EXPECT_EQ(10, colHeaders.size());
EXPECT_TRUE(colHeaders[9][0].find_first_of("FGPTH") != std::string::npos);
EXPECT_TRUE(colHeaders[9][1].find_first_of("SM3") != std::string::npos);
EXPECT_TRUE(colHeaders[9][2].find_first_of("*10**6") != std::string::npos);
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST(FixedWidthDataParser, ColumnData)
{
std::vector<std::vector<std::string>> columnData;
{
std::vector<std::string> col;
col.push_back("FGPTH");
col.push_back("SM3");
col.push_back("*10**6");
columnData.push_back(col);
}
auto ci = RifEclipseUserDataParserTools::columnInfoFromColumnHeaders(columnData);
EXPECT_EQ(1, ci.size());
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST(FixedWidthDataParser, DetectFixedWidth)
{
QString data = R"(
1
-------------------------------------------------------------------------------------------------------------------------------
SUMMARY OF RUN NORNE_ATW2013_RFTPLT_V3 ECLIPSE 2016.2 DATESTAMP 13-DEC-2016
-------------------------------------------------------------------------------------------------------------------------------
DATE YEARS NEWTON MLINEARS DAY MONTH YEAR NEWTON TCPU ELAPSED
YEARS SECONDS SECONDS
-------------------------------------------------------------------------------------------------------------------------------
6-NOV-1997 0 0 0 6 11 1997 0 4.880000 9.720000
7-NOV-1997 0.002738 3 28 7 11 1997 3 5.240000 10.11000
8-NOV-1997 0.006556 4 42 8 11 1997 4 5.730000 10.60000
9-NOV-1997 0.009231 3 28 9 11 1997 3 6.080000 10.95000
10-NOV-1997 0.011462 4 32 10 11 1997 4 6.500000 11.37000
11-NOV-1997 0.013710 4 35 11 11 1997 4 6.940001 11.81000
11-NOV-1997 0.015950 3 25 11 11 1997 3 7.270000 12.14000
12-NOV-1997 0.018477 4 35 12 11 1997 4 7.710001 12.58000
13-NOV-1997 0.020190 3 24 13 11 1997 3 8.040000 12.91000
14-NOV-1997 0.021903 3 27 14 11 1997 3 8.380000 13.25000
14-NOV-1997 0.024232 2 17 14 11 1997 2 8.640000 13.57000
17-NOV-1997 0.030838 3 26 17 11 1997 3 8.980000 13.91000
19-NOV-1997 0.037060 3 30 19 11 1997 3 9.350000 14.28000
1
-------------------------------------------------------------------------------------------------------------------------------
SUMMARY OF RUN NORNE_ATW2013_RFTPLT_V3 ECLIPSE 2016.2 DATESTAMP 13-DEC-2016
-------------------------------------------------------------------------------------------------------------------------------
DATE RGIR RGPR RGIPG RGIPL RGIT RGPT RWIR RWPR RWPT
SM3/DAY SM3/DAY SM3 SM3 SM3 SM3 SM3/DAY SM3/DAY SM3
*10**3 *10**3 *10**3 *10**3
1 1 1 1 1 1 1 1 1
-------------------------------------------------------------------------------------------------------------------------------
6-NOV-1997 0 0 5426677. 591448.1 0 0 0 0 0
7-NOV-1997 0 2396930. 5424424. 591498.1 0 2396.930 0 -21.6173 -21.6173
8-NOV-1997 0 -250487. 5423940. 591966.2 0 2047.598 0 -11124.0 -15535.3
9-NOV-1997 0 2829432. 5421400. 591952.3 0 4812.102 0 -17.8744 -15552.8
10-NOV-1997 0 -280634. 5421285. 592209.2 0 4583.461 0 -10959.9 -24482.1
11-NOV-1997 0 2830404. 5419148. 592196.6 0 6908.132 0 -10.3646 -24490.7
11-NOV-1997 0 -295420. 5419071. 592429.6 0 6666.499 0 -10081.2 -32736.4
12-NOV-1997 0 2653586. 5416835. 592407.6 0 9116.355 0 1.209827 -32735.3
13-NOV-1997 0 -360534. 5416802. 592585.4 0 8890.818 0 -9987.70 -38983.3
14-NOV-1997 0 2637960. 5415305. 592557.9 0 10541.03 0 14.09936 -38974.5
14-NOV-1997 392181.0 1892660. 5414172. 592553.9 333.6561 12151.25 0 12.94364 -38963.4
17-NOV-1997 392181.0 -248070. 5414992. 592978.2 1279.883 11552.73 0 -6587.17 -54856.5
19-NOV-1997 392181.0 2105310. 5411504. 592928.2 2171.132 16337.13 0 50.99986 -54740.6
1
-------------------------------------------------------------------------------------------------------------------------------
SUMMARY OF RUN NORNE_ATW2013_RFTPLT_V3 ECLIPSE 2016.2 DATESTAMP 13-DEC-2016
-------------------------------------------------------------------------------------------------------------------------------
DATE RWIP ROPR ROIR ROIT ROIPG ROIPL ROPT WBP5 WBP5
SM3 SM3/DAY SM3/DAY SM3 SM3 SM3 SM3 BARSA BARSA
*10**3
C-4H B-2H
1 1 1 1 1 1 1
-------------------------------------------------------------------------------------------------------------------------------
6-NOV-1997 11497.27 0 0 0 311329.6 5356031. 0 267.8818 272.3813
7-NOV-1997 11497.30 136.0644 0 0 310820.4 5356412. 136.0644 267.5505 271.7487
8-NOV-1997 11512.83 -2235.10 0 0 307801.2 5359464. -2981.04 267.9665 271.5258
9-NOV-1997 11512.86 164.4799 0 0 307597.5 5359512. -2820.33 267.7249 271.3749
10-NOV-1997 11521.80 -2242.95 0 0 307640.1 5361289. -4647.73 267.9192 271.2401
11-NOV-1997 11521.82 167.4484 0 0 307474.1 5361327. -4510.20 267.6667 271.1284
11-NOV-1997 11530.07 -2050.93 0 0 307511.9 5362954. -6187.72 267.9205 271.0045
12-NOV-1997 11530.08 159.2625 0 0 307328.3 5362987. -6040.69 267.6598 270.8947
13-NOV-1997 11536.33 -2048.92 0 0 307366.7 5364262. -7322.42 267.8667 270.8219
14-NOV-1997 11536.33 163.7713 0 0 307245.2 5364278. -7219.97 267.6961 270.7566
14-NOV-1997 11536.32 110.5641 0 0 307121.3 5364291. -7125.90 267.7364 270.6674
17-NOV-1997 11552.19 -1263.74 0 0 307151.2 5367307. -10175.0 268.3125 270.3454
19-NOV-1997 11552.09 133.3163 0 0 306850.8 5367300. -9872.00 267.8979 270.1126
)";
EXPECT_TRUE(RifEclipseUserDataParserTools::isFixedWidthHeader(data.toStdString()));
// RifColumnBasedUserDataParser parser(data);
// auto tables = parser.tableData();
// EXPECT_EQ(3, tables.size());
/*
auto mergedTables = RifEclipseUserDataParserTools::mergeEqualTimeSteps(tables);
EXPECT_EQ(1, mergedTables.size());
EXPECT_EQ(28, mergedTables[0].size());
*/
}
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST(FixedWidthDataParser, VaryingTimeStepCount)
{
QString data =
"1 \n"
" -------------------------------------------------------------------------------------------------------------------------------\n"
" SUMMARY OF RUN NORNE_ATW2013_RFTPLT_V3 ECLIPSE 2016.2 DATESTAMP 13-DEC-2016 \n"
" -------------------------------------------------------------------------------------------------------------------------------\n"
" DATE YEARS NEWTON MLINEARS DAY MONTH YEAR NEWTON TCPU ELAPSED \n"
" YEARS SECONDS SECONDS \n"
" \n"
" \n"
" -------------------------------------------------------------------------------------------------------------------------------\n"
" 6-NOV-1997 0 0 0 6 11 1997 0 4.880000 9.720000 \n"
" 7-NOV-1997 0.002738 3 28 7 11 1997 3 5.240000 10.11000 \n"
" 8-NOV-1997 0.006556 4 42 8 11 1997 4 5.730000 10.60000 \n"
" 9-NOV-1997 0.009231 3 28 9 11 1997 3 6.080000 10.95000 \n"
" 10-NOV-1997 0.011462 4 32 10 11 1997 4 6.500000 11.37000 \n"
" 11-NOV-1997 0.013710 4 35 11 11 1997 4 6.940001 11.81000 \n"
" 11-NOV-1997 0.015950 3 25 11 11 1997 3 7.270000 12.14000 \n"
" 12-NOV-1997 0.018477 4 35 12 11 1997 4 7.710001 12.58000 \n"
" 13-NOV-1997 0.020190 3 24 13 11 1997 3 8.040000 12.91000 \n"
" 14-NOV-1997 0.021903 3 27 14 11 1997 3 8.380000 13.25000 \n"
" 14-NOV-1997 0.024232 2 17 14 11 1997 2 8.640000 13.57000 \n"
" 17-NOV-1997 0.030838 3 26 17 11 1997 3 8.980000 13.91000 \n"
" 19-NOV-1997 0.037060 3 30 19 11 1997 3 9.350000 14.28000 \n"
"1 \n"
" -------------------------------------------------------------------------------------------------------------------------------\n"
" SUMMARY OF RUN NORNE_ATW2013_RFTPLT_V3 ECLIPSE 2016.2 DATESTAMP 13-DEC-2016 \n"
" -------------------------------------------------------------------------------------------------------------------------------\n"
" DATE RGIR RGPR RGIPG RGIPL RGIT RGPT RWIR RWPR RWPT \n"
" SM3/DAY SM3/DAY SM3 SM3 SM3 SM3 SM3/DAY SM3/DAY SM3 \n"
" *10**3 *10**3 *10**3 *10**3 \n"
" \n"
" 1 1 1 1 1 1 1 1 1 \n"
" -------------------------------------------------------------------------------------------------------------------------------\n"
" 6-NOV-1997 0 0 5426677. 591448.1 0 0 0 0 0 \n"
" 7-NOV-1997 0 2396930. 5424424. 591498.1 0 2396.930 0 -21.6173 -21.6173 \n"
" 8-NOV-1997 0 -250487. 5423940. 591966.2 0 2047.598 0 -11124.0 -15535.3 \n"
" 9-NOV-1997 0 2829432. 5421400. 591952.3 0 4812.102 0 -17.8744 -15552.8 \n"
" 10-NOV-1997 0 -280634. 5421285. 592209.2 0 4583.461 0 -10959.9 -24482.1 \n"
" 11-NOV-1997 0 2830404. 5419148. 592196.6 0 6908.132 0 -10.3646 -24490.7 \n"
" 11-NOV-1997 0 -295420. 5419071. 592429.6 0 6666.499 0 -10081.2 -32736.4 \n"
" 12-NOV-1997 0 2653586. 5416835. 592407.6 0 9116.355 0 1.209827 -32735.3 \n"
" 13-NOV-1997 0 -360534. 5416802. 592585.4 0 8890.818 0 -9987.70 -38983.3 \n"
" 14-NOV-1997 0 2637960. 5415305. 592557.9 0 10541.03 0 14.09936 -38974.5 \n"
;
// RifColumnBasedUserDataParser parser(data);
// auto tables = parser.tableData();
// EXPECT_EQ(2, tables.size());
/*
auto mergedTables = RifEclipseUserDataParserTools::mergeEqualTimeSteps(tables);
EXPECT_EQ(2, mergedTables.size());
*/
}

View File

@@ -231,8 +231,7 @@ TEST(RifRsmspecParserToolsTest, TestSplitLineToDoubles)
while (std::getline(streamData, line))
{
std::vector<double> values;
RifEclipseUserDataParserTools::splitLineToDoubles(line, values);
std::vector<double> values = RifEclipseUserDataParserTools::splitLineToDoubles(line);
table.push_back(values);
}