RALPHQC
asked on
create a text file from a text field and maintain the carriage returns.
I setup a text field that contins the following. I would liket to export it to a text file and keep the carriage returns. I tried export field content . I tried export in general. I cannot get it to work . thanks
S,856SOPI,
O,3705862,,FL,,0010,CTN25, 5,.05,0272
P,,,
I,657274001051,1,,EA
O,3705862,,FL,,0012,CTN25, 4,.05,0272
P,,,
I,657274001051,1,,EA
O,3705862,,FL,,0014,CTN25, 4,.05,0272
P,,,
I,657274001051,1,,EA
O,3705862,,FL,,0015,CTN25, 4,.05,0272
P,,,
I,657274001051,1,,EA
S,856SOPI,
O,3705862,,FL,,0010,CTN25,
P,,,
I,657274001051,1,,EA
O,3705862,,FL,,0012,CTN25,
P,,,
I,657274001051,1,,EA
O,3705862,,FL,,0014,CTN25,
P,,,
I,657274001051,1,,EA
O,3705862,,FL,,0015,CTN25,
P,,,
I,657274001051,1,,EA
The only way I can think off will require post processing on the text file. Since Filemaker exports Carriage returns as ASCII (11) or CTRL (K), you may want to replace CTRL (K)'s with CTRL(M)'s which is a carriage return, with the text editor after export. Since you haven't provided the platform you intend to use the file, I don't know if you need a Line Feed or not , I presume CTRL(M) will take you to the next line in your text editor.
The only way to get the right text encoding is to export the data as XML using a basic XSLT file like:
If it's just for a single record I usually do this via a script and a secondary table with only one record and a global text field. Using a global text field allows you to set its value from unrelated tables.
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fm="http://www.filemaker.com/fmpxmlresult" exclude-result-prefixes="fm" >
<xsl:output method="html" version="1.0" encoding="utf-8" indent="yes"/>
<xsl:template match="/">
<xsl:value-of select="fm:FMPXMLRESULT/fm:RESULTSET/fm:ROW/fm:COL/fm:DATA" disable-output-escaping="yes"/>
</xsl:template>
</xsl:stylesheet>
If it's just for a single record I usually do this via a script and a secondary table with only one record and a global text field. Using a global text field allows you to set its value from unrelated tables.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
that's the solution that i used.