Brian C Posted June 26, 2008 Posted June 26, 2008 I am searching for a FM Plugin or perhaps a stylesheet that will allow me to export a a single field containing fixed length data to a file that will contain a LF character at the end of each line. Prior to version 9, I as able to do this because I could store the LF character in a calculation and insert that into the field data prior to exporting the single field as Tab Delimited (only 1 field means no tabs). Now however, FM 9 will no longer allow me to insert the LF character into a calculation. It auto-replaces the LF with a CR which throws a small kink into my automated processes. My current workaround is to insert a pipe character at the beginning of each line (following line 1) so that there is a pipe character immediately following each CR. I then manually do a find/replace to add the LF characters. It works, but I would prefer to not have this extra step if possible. Any ideas?
Vaughan Posted June 26, 2008 Posted June 26, 2008 An XML export can do this. There are style-sheets around that either do it, or could do it with little modification. Look on the FMI web site.
Brian C Posted June 26, 2008 Author Posted June 26, 2008 My thanks to Mr Vodka (offline) for suggesting the idea of using a stylesheet and my thanks to Vaughan for pointing me in the right direction so that I could locate the required stylesheet. For anyone interested here is how I got it to work. Download: http://transfer.filemaker.com/collection/XMLExamples.zip Open the "custom_delim.xsl" stylesheet file. Scroll to the bottom. Change the newrecord variable delimiter from a Carriage Return to a Line Feed character. Save and close the file. Edit filemaker Export script step by changing the export file type from Tab Delimited to XML, and when prompted, point it to the "custom_delim.xsl" stylesheet. Run the export and and voila! It works like a charm!
Brian C Posted June 26, 2008 Author Posted June 26, 2008 New question: Is it possible to store the XSL stylesheet in the Export script step itself? Or does it have to be an external file? If this is possible, how would I format the data so that it will work?
comment Posted June 26, 2008 Posted June 26, 2008 It has to be an external file. But you could keep the file in a container, or even in a text field, and export it to a known location before doing the "real" export.
Brian C Posted June 26, 2008 Author Posted June 26, 2008 Thanks Comment, that is a good idea. I remember seeing that done before in a Nightwing Demo for FMP 9 features (Dialog box as I recall) ... I'll look that up for reference to get this working the rest of the way. I will try to take time to post what I did for that as well in case others are interested in the read once I'm done.
dpmnyc Posted June 23, 2009 Posted June 23, 2009 (edited) Hi and thank you in advance... How would I make this work if I needed to insert an CRLF at the end of each line? I am using FMP 9.0 on a Mac (which typically doesnt like LFs). dp Edited June 23, 2009 by Guest added information about platform
Fenton Posted June 23, 2009 Posted June 23, 2009 (edited) You can put the two characters in the variable "newrecord". Like this (difficult to post here), but works if you do it twice: Edited June 23, 2009 by Guest
Recommended Posts
This topic is 5631 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 accountSign in
Already have an account? Sign in here.
Sign In Now