mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#5847 Eclipse Ascii Case: Import of properties with comment in header fails
This commit is contained in:
parent
4d98a8d502
commit
5de98ea7b0
@ -846,11 +846,36 @@ bool RifEclipseInputFileTools::readProperty( const QString& fileName,
|
||||
return false;
|
||||
}
|
||||
|
||||
ecl_kw_type* eclipseKeywordData = ecl_kw_fscanf_alloc_grdecl_dynamic__( filePointer,
|
||||
qint64 filePos = -1;
|
||||
|
||||
{
|
||||
std::vector<RifKeywordAndFilePos> keywordsAndFilePos;
|
||||
findKeywordsOnFile( fileName, &keywordsAndFilePos );
|
||||
for ( auto kwAndPos : keywordsAndFilePos )
|
||||
{
|
||||
if ( kwAndPos.keyword == eclipseKeyWord )
|
||||
{
|
||||
filePos = kwAndPos.filePos;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool isOk = false;
|
||||
|
||||
if ( filePos == -1 )
|
||||
{
|
||||
RiaLogging::error( QString( "Failed to load keyword %1 from file: %2" ).arg( eclipseKeyWord ).arg( fileName ) );
|
||||
}
|
||||
else
|
||||
{
|
||||
fseek( filePointer, filePos, SEEK_SET );
|
||||
|
||||
ecl_kw_type* eclipseKeywordData =
|
||||
ecl_kw_fscanf_alloc_grdecl_dynamic__( filePointer,
|
||||
eclipseKeyWord.toLatin1().data(),
|
||||
false,
|
||||
ecl_type_create_from_type( ECL_FLOAT_TYPE ) );
|
||||
bool isOk = false;
|
||||
|
||||
if ( eclipseKeywordData )
|
||||
{
|
||||
QString errMsg;
|
||||
@ -865,6 +890,7 @@ bool RifEclipseInputFileTools::readProperty( const QString& fileName,
|
||||
{
|
||||
RiaLogging::error( QString( "Failed to load keyword %1 from file: %2" ).arg( eclipseKeyWord ).arg( fileName ) );
|
||||
}
|
||||
}
|
||||
|
||||
fclose( filePointer );
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user