Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Exporting Carriage returns and the hassles.......


This topic is 7313 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I'm trying to export one field, and it's not performing exactly as I would like.

I've got one large text field, and each line is separated by the carriage return "

Posted

Since you are using MS Word to edit the text, why not do a little trick by saving the output coded as HTML, except change the file extension to "DOC". When the file is opened in Word, it will format it as a Word document.

You can then substitute the FM carriage return with "<BR>" or some other HTML coding.

This method can also be used to retain formatting of the text using HTML code. and some calculation fields and some scripting.

Posted

Hmm, the idea seemed slick enough at first. After exporting as HTML and changing the extension, it opened in word fine, but it shows all of the HTML tags along with all of the text.

I don't think it makes a difference, but I am using MS Word '97. Even if I was using a more "current" version, it still wouldn't work, since clients may be using a different word processor, over even a basic text editor.

Any other ideas?

Posted

FM substitutes carriage retursn with Vertical Tabs (since CR and LF are end-or-record delimiters for just about any export format).

Since you're using FM7, have you tried the 'export field content' script step instead of do a real export? IIRC that should leave the CR's intact.

Posted

Oh, yes - that "export field content' step works just fine. I never knew that step was there and available in V7. I'm definately going to find that step handy.

Unfortunately, I'm developing this particular piece with FMP 6. Any ideas on how to do this without this slick script step?

Posted

You could try XML export, with an XSL stylesheet. Here is a fairly universal stylesheet to produce text, for FileMaker DSO result (not XML result, though I'm sure that's doable also). The result is a UTF-8 text file, which Word should support. I'm on Mac OS X, but on my old Windows2000 PC even WordPad supports Unicode text. Worth a try. Save below as text file, extension ".xsl".

&#09; is a Tab, between fields, &#10; is a Unix line ending, between records, standard for xml:

<?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/fmpdsoresult">

<xsl:output method="text" version="1.0" encoding="UTF-8" indent="no"/>

<xsl:template match="/">

<xsl:for-each select="fmp:FMPDSORESULT/fmp:ROW">

<xsl:for-each select="./*">

<xsl:value-of select="." />

<xsl:text>&#09;</xsl:text>

</xsl:for-each>

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

</xsl:for-each>

</xsl:template>

</xsl:stylesheet>

Posted

Ahhh- I thought that it might come to exporting/using XML/XSL. Unfortunately, this is new waters I'm treading into.

Unless this will get really messy to explain to someone who doesn't know ANYthing about the subject, how do you set all of this up / make it work (in good detail)? If it's going to take you too long to explain, don't hassle - I'll figure it out eventually.

Thanks!

Posted

It's actually fairly simple, especially if it's just on your stand-alone computer. That stuff I posted is just text. Copy and paste into a text file. Give it the extension ".xsl." Make sure the program doesn't add a hidden extension (like .xml, dumb programs think .xml is the only XML extension), or other junk characters. Do NOT use MS Word, unless you force it to produce a clean file.

Then, when you Export from FileMaker, drop-down the list of formats, XML is at the bottom. It will ask where you want it and what to name it (File Reference), then pop-up a new dialog, where you choose the FileMaker XML format. This drop-down, at top left, is easy to miss. It can be either FMPDSORESULT or FMPXMLRESULT.

[i used DSO, 'cause it's a little simpler. FileMaker says it's "deprecated", which means they don't really like it anymore, but you can ignore them.]

There is also a radio button choice, to specify an XSL stylesheet. You click "File", then go find your .xsl text file. That's all. Then Export. If anything's wrong, you'll get an error message, which may or may not help.

The thing I posted is actually very clever (which means I didn't come up with the original idea). The way it is written will match any FileMaker file. It just gets the text in every exported field, in every exported record. It puts a Tab between fields, and a Unix return after each record. The result is a Unicode text file with UTF-8 encoding.

Whether it will solve your problem or not I'm not sure, as I'm not on Windows 2000. But it appears to not export the Vertical Tabs, which is the problem.

Posted

SWEET! It worked just you described, Fenton. It's kind of a screwy way to do something that seems fairly simple, but whatever.

Thanks everyone for the help!

This topic is 7313 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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