Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

I'm using &#0x0D; and &#0x0A; for CR/LF in a script for export in CSV-format which is to be imported in a Windows based system. The receiver on the other side of the fence tells me that these codes are wrong. His best guess are 
 and 
 but everything is open for other suggestions. When my CSV are opened in Excel Win there are double LF. I encolse a copy of the file.

Mac with El Capitan and Filemaker 11 Pro Advanced 11.0v4.

My current script:

<?xml version="1.0" encoding="UTF-8"?>

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fmp="http://www.filemaker.com/fmpxmlresult">

<xsl:output method="text" encoding="ISO-8859-1"/>

<xsl:variable name="CRLF">
<xsl:text>&#x000D;&#x000A;</xsl:text>
</xsl:variable>

<xsl:variable name="delimiter">
    <xsl:text>;</xsl:text>
</xsl:variable>

<xsl:template match="/">
    <xsl:text>EAN;Katalognr;Pladeselskab;Kunstnernavn;Titel;Komponist;Artikeltype;Listepris;Releasedato;Kontrakt&#x000D;&#x000A;</xsl:text>

<xsl:for-each select="fmp:FMPXMLRESULT/fmp:RESULTSET/fmp:ROW">
    <xsl:for-each select="fmp:COL">
        <xsl:value-of select="fmp:DATA"/>
        <xsl:choose>
            <xsl:when test="position()=last()">
                <xsl:value-of select="$CRLF"/>
            </xsl:when>
            <xsl:otherwise>
                <xsl:value-of select="$delimiter"/>
            </xsl:otherwise>
        </xsl:choose>
    </xsl:for-each>
</xsl:for-each>

<xsl:variable name="date" select="fmp:COL[9]/fmp:DATA"/>
<xsl:value-of select="substring-after(substring-after($date, '/'), '/')"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring-before(substring-after($date, '/'), '/')"/>
<xsl:text>-</xsl:text>
<xsl:value-of select="substring-before($date, '/')"/>

</xsl:template>
</xsl:stylesheet>

test.csv

Edited by Kurt Hansen

Does it work using:

<xsl:variable name="newline">
<xsl:text>&#10;</xsl:text>
</xsl:variable>

?

Edited by ggt667

7 hours ago, Kurt Hansen said:

When my CSV are opened in Excel Win there are double LF.

That may be an Excel issue. I opened your file in a text editor and I see (only) a CRLF separating the lines. A hex dump shows 74 0D 0A 38 (i.e. "t, CR, LF, 8") at the first line break.

 

7 hours ago, Kurt Hansen said:

His best guess are &#xD; and &#xA;

&#x000D; and &#xD; are exactly the same thing - and so is &#13;.

 

7 hours ago, Kurt Hansen said:

everything is open for other suggestions.

Try using only LF as the line separator?

 

6 hours ago, ggt667 said:

<xsl:text>&10;</xsl:text>

That cannot work and will produce an error.

 

Edited by comment

2 hours ago, comment said:
2 hours ago, comment said:

That cannot work and will produce an error.

Sorry, typo should be: <xsl:text>&#10;</xsl:text>

  • 4 weeks later...

rather than "10" (LF), what happens if you just use "13" (CR)?

beverly

If you are exporting from FileMaker I doubt the encoding should be: <xsl:output method="text" encoding="ISO-8859-1"/>

At least I have used:<xsl:output method="text" encoding="UTF-8"/> for FileMaker 5 and up, I doubt there is anything that uses ISO-8859-n after Windows 2000, MacOS X and linux was released.

Edited by ggt667

50 minutes ago, ggt667 said:

I doubt the encoding should be: <xsl:output method="text" encoding="ISO-8859-1"/>

I believe that depends on the target application - of which we know nothing.

And it has nothing to do with the problem.

1 hour ago, comment said:

And it has nothing to do with the problem.

True, but it makes me wonder if there is something really old being worked on. An this could be a part of the path to finding the actual issue.

The simplest way to solve the issue is to make a text file on the destination system and find out which line break is used

The attached example clearly uses the CRLF as pr <xsl:text>&#x000D;&#x000A;</xsl:text>

xxd /home/user/99415-crlf-in-output-to-windows//test.csv | head -n 7 | tail -n 1
00000060: 6b74 0d0a 3830 3134 3339 3935 3030 3532  kt..801439950052

On the Mac newline is clearly: #10 or #x0A

$ echo "" | xxd
00000000: 0a                                       .

I have tested the test.csv file from initial post in LibreOffice, and OpenOffice and I see no such symptoms as described. Makes me think it's an old Windows or Office.

Edited by ggt667

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.