Skip to content

Commit

Permalink
delimited text: let field names be numerical value
Browse files Browse the repository at this point in the history
fixes #19638 "CSV: numeric header gets a trailing underscore + 1"
fixes #13187 "Numeric FIELD names are lost on CSV import"

(cherry picked from commit 379652d)
  • Loading branch information
agiudiceandrea authored and nyalldawson committed Aug 31, 2018
1 parent 72331fe commit a5fd813
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/providers/delimitedtext/qgsdelimitedtextfile.cpp
Expand Up @@ -34,8 +34,7 @@ QgsDelimitedTextFile::QgsDelimitedTextFile( const QString &url )
: mFileName( QString() )
, mEncoding( QStringLiteral( "UTF-8" ) )
, mDefaultFieldName( QStringLiteral( "field_%1" ) )
// field_ is optional in following regexp to simplify QgsDelimitedTextFile::fieldNumber()
, mDefaultFieldRegexp( "^(?:field_)?(\\d+)$", Qt::CaseInsensitive )
, mDefaultFieldRegexp( "^(?:field_)(\\d+)$", Qt::CaseInsensitive )
{
// The default type is CSV
setTypeCSV();
Expand Down

0 comments on commit a5fd813

Please sign in to comment.