Skip to content
Permalink
Browse files

delimited text: let field names be numerical value

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 21, 2018
1 parent 72331fe commit a5fd81373fddcd0098cf07556eda0b9f02e40ccb
Showing with 1 addition and 2 deletions.
  1. +1 −2 src/providers/delimitedtext/qgsdelimitedtextfile.cpp
@@ -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();

0 comments on commit a5fd813

Please sign in to comment.
You can’t perform that action at this time.