mirror of
https://github.com/subsurface/subsurface.git
synced 2024-11-28 05:00:20 +00:00
Support importing quoted multi-line notes field
This adds support for importing multi-line notes field on CSV import. Naturally the notes filed must be quoted with " in this case. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
b3e3947b79
commit
83ccf24e1e
1 changed files with 8 additions and 2 deletions
|
@ -55,6 +55,7 @@
|
|||
|
||||
<xsl:call-template name="printFields">
|
||||
<xsl:with-param name="line" select="$line"/>
|
||||
<xsl:with-param name="remaining" select="$remaining"/>
|
||||
</xsl:call-template>
|
||||
|
||||
<xsl:if test="$remaining != ''">
|
||||
|
@ -67,6 +68,7 @@
|
|||
|
||||
<xsl:template name="printFields">
|
||||
<xsl:param name="line"/>
|
||||
<xsl:param name="remaining"/>
|
||||
|
||||
<xsl:variable name="number">
|
||||
<xsl:choose>
|
||||
|
@ -313,6 +315,7 @@
|
|||
<xsl:call-template name="getFieldByIndex">
|
||||
<xsl:with-param name="index" select="$notesField"/>
|
||||
<xsl:with-param name="line" select="$line"/>
|
||||
<xsl:with-param name="remaining" select="$remaining"/>
|
||||
</xsl:call-template>
|
||||
</notes>
|
||||
</xsl:if>
|
||||
|
@ -345,6 +348,7 @@
|
|||
<xsl:template name="getFieldByIndex">
|
||||
<xsl:param name="index"/>
|
||||
<xsl:param name="line"/>
|
||||
<xsl:param name="remaining"/>
|
||||
<xsl:choose>
|
||||
<xsl:when test="$index > 0">
|
||||
<xsl:choose>
|
||||
|
@ -352,12 +356,14 @@
|
|||
<xsl:call-template name="getFieldByIndex">
|
||||
<xsl:with-param name="index" select="$index -1"/>
|
||||
<xsl:with-param name="line" select="substring-after($line, $fs)"/>
|
||||
<xsl:with-param name="remaining" select="$remaining"/>
|
||||
</xsl:call-template>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:call-template name="getFieldByIndex">
|
||||
<xsl:with-param name="index" select="$index -1"/>
|
||||
<xsl:with-param name="line" select="substring-after($line, $fs)"/>
|
||||
<xsl:with-param name="remaining" select="$remaining"/>
|
||||
</xsl:call-template>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
@ -370,8 +376,8 @@
|
|||
<xsl:value-of select="substring-before($line,'"$fs')"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:if test="substring-after($line, '"$fs') = ''">
|
||||
<xsl:value-of select="substring-before(substring-after($line, '"'), '"')"/>
|
||||
<xsl:if test="substring-after(substring-after($line, '"'), '"') = ''">
|
||||
<xsl:value-of select="concat(substring-after($line, '"'), substring-before($remaining, '"'))"/>
|
||||
</xsl:if>
|
||||
</xsl:otherwise>
|
||||
</xsl:choose>
|
||||
|
|
Loading…
Reference in a new issue