diff options
author | Miika Turkia <miika.turkia@gmail.com> | 2018-10-07 16:53:36 +0300 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2018-10-07 17:41:14 +0300 |
commit | f0409123958fb41daefb5e0b22d2243598fa0c5f (patch) | |
tree | 947b1a2d93c4c7f00c577f849a5d9d8d3b9b09ac /xslt | |
parent | 3f5b5f7b3ed632aecd1e439a6f1775755683f76f (diff) | |
download | subsurface-f0409123958fb41daefb5e0b22d2243598fa0c5f.tar.gz |
CSV import: import of last field
The last field ends with new line instead of field separator.
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
Diffstat (limited to 'xslt')
-rw-r--r-- | xslt/commonTemplates.xsl | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/xslt/commonTemplates.xsl b/xslt/commonTemplates.xsl index 18b50b739..74362df92 100644 --- a/xslt/commonTemplates.xsl +++ b/xslt/commonTemplates.xsl @@ -330,9 +330,8 @@ <xsl:choose> <xsl:when test="substring($line, 1, 1) = '"'"> <xsl:choose> - <xsl:when test="substring-before(substring-after($line, '"'), concat('"', $fs)) != ''"> - - + <!-- We either have a field that ends with quote and field separator, or the last character of line is quote --> + <xsl:when test="substring-before(substring-after($line, '"'), concat('"', $fs)) != '' or substring($line, string-length($line), 1)"> <xsl:choose> <xsl:when test="substring-before(substring-before(substring-after($line, '"'), concat('"', $fs)), '"') != ''"> <xsl:call-template name="unquote"> @@ -340,6 +339,9 @@ <xsl:with-param name="value" select="''" /> </xsl:call-template> </xsl:when> + <xsl:when test="substring($line, string-length($line), 1) = '"'"> + <xsl:value-of select="substring-before(substring-after($line, '"'), '"')"/> + </xsl:when> <xsl:otherwise> <xsl:value-of select="substring-before(substring-after($line, '"'), concat('"', $fs))"/> |