I have an rtf string (imported from Oracle 11g) on which I've run a string replacement and now want to export using Export Records. How can I encode it in Western (Windows Latin 1)?
Check out the TextEncode function in FileMaker 16, may be what you are looking for
FileMaker Pro 16 Help
Then follow it with an Export Field Content script step
Help page has this as an example
Set Field [ table::container ; TextEncode ( table::text ; "iso-8859-1" ; 4 )
Export Field Contents [ table::container ; "output.txt" ]
I hope this helps
Great new function! It uses the text in a single field and makes it a "container" document so that
Export Field Contents
will give you the desired output. However, I believe OP was asking for encoding on Export Records.
@dem, I'll ask what format are you using for your Export Records?
.tab/.txt, .csv, ???
There are ways to change some settings depending on the platform (MacOS, Win, ??) and the FM version (??) that you are using. Can you supply a bit more information, please?
Still getting the same problem. Saved rtf is unreadable by Word. However, opening the saved RTF with BBEdit and then saving in Western (Windows Latin 1) with CRLF gives perfect results!
Sever is on Windows 2012 with Mac & Windows clients both giving same results in FMP 15 and 16.
Maybe the pb is due to the import from Oracle? Does FMP encode when importing?
If you use MBS FileMaker Plugin, you can take a look on the text functions.
The function Text.ReplaceNewline helps to get Mac/Windows/Linux line endings.
And Text.WriteTextFile can write text to a file with any encoding you need.
The function Text.TextToRTF can help to convert styled text to RTF.
e.g. write a RTF from field:
Set Variable [$rtf; Value:MBS( "Text.TextToRTF"; "Hello World äöü ß" )]
Set Variable [$r; Value:MBS( "Text.WriteTextFile"; $rtf; "/Users/cs/Desktop/test.rtf"; "Windows")]
@dem Have you tried saving the file with a .doc extension, I have just given it a quick test and it worked foe me on Windows [.docx as the file extension did fail however]
the "x" on the Office extensions if a compressed format. I don't know a way to do that with an export (text file). I'm sure the plug-ins and other means can make the format. So for export from FileMaker, I use .doc, .xls, etc.
Beverly & Orlando: Found the solution: TextEncode ("windows-1252" ; 4 ) to a container field followed by Export Field Contents.
Many thanks to both for your input.
Anyone know how to create PDF's on-the-fly from a container field using PHP API?
Glad to hear you have found a solution.
With regards to the PDF, what exactly are you trying to do, is this the same file you are exporting as a word document, or a different one? Also if its a new question it would be best to raise a new thread as people who have an answer may miss this question.
Will start new thread.
Since you have the data from the text file already in FileMaker why not use the Save As PDF function to generate the PDF without PHP
Can't that only save the Record as PDF?
Yes, so if I got this right, could you use the same data you are using to create your text file on a layout and PDF the layout?
Apologies if I misunderstood your request
Retrieving data ...