markm Posted April 3, 2009 Share Posted April 3, 2009 Hello there, I am trying to export text from a single field which contains "¶". The output text file needs to be ASCII encoded and CRLF delimited. Are the "¶" from Filemaker working as CRLF delimiters? Or can I set a CR directly in the Filemaker field instead of the "¶"? Many thanks, Mark (8.0 Pro on Mac OSX 10.4) Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted April 3, 2009 Share Posted April 3, 2009 the ¶'s in FileMaker are not CRLF, nor CR alone nor LF alone, but instead an obscure char known as a "vertical tab", sometimes also described as ASCII 11 or hex 0xb or represented as \v. True line endings are reserved for behind-the-scenes use as record delimiters, just as they are in standard tab-delimited or comma-separated text. (Therefore, no, you can't put a true ¶ in a text field). You would need to use a text editor such as BBEdit or TextWrangler (or, if you're on a PC, whatever in God's name PC users use nowadays as a text editor. I alway see them using this way-underpowered useless thing called NotePad, but I assume there are real text editors on a PC). You would open the exported file and do a replace all and replace the vertical tab char with the CRLF you need. Quote Link to comment Share on other sites More sharing options...
markm Posted April 3, 2009 Author Share Posted April 3, 2009 Many thanks so far. Is there no way to do the replacing in Filemaker before the export? I seem to vaguely remember that it would be possible to script ASCII characters ( or the like?) but might be that I am wrong... Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted April 3, 2009 Share Posted April 3, 2009 I won't say it's not possible, but I will say that I don't know how one would go about doing that. Maybe someone else does. One problem is that FileMaker auto-converts typed or represented hard returns INTO those vertical-tab chars. You can copy a hard return from outside of FileMaker and paste it, no problem, but what gets stored is in the vertical tab. Quote Link to comment Share on other sites More sharing options...
markm Posted April 5, 2009 Author Share Posted April 5, 2009 I noticed that when I use the "Export Records" action, I get the vertical tab, which, as you say, is not recognized as a CRLF delimiter in Textwrangler. However when I use "Export Field Contents" instead I seem to get a CR instead. At least Textwrangler seems to treat it at such. Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted April 5, 2009 Share Posted April 5, 2009 Cool! I had not thought of using Export Field Contents. (Silly, since you specifically said "from a single field". I guess I was thinking "yeah but from a multitude of records"). Can you use CR or does it have to be CR LF? Quote Link to comment Share on other sites More sharing options...
markm Posted April 5, 2009 Author Share Posted April 5, 2009 I got to check - I am just working by a spec that says "Data ASCII encoded and CRLF delimited". I am not really familiar with ASCII. Do you know of a way to check what character I actually have there? Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted April 5, 2009 Share Posted April 5, 2009 In TextWrangler or BBEdit, copy the hard return to clipboard (using Show Invisibles will probably help) and bring up the find & replace window; paste and then tab out of the "search for" window and it should translate what you pasted into special code characters. If it did NOT, hit OK and then do a ⌘-F again and it should show them now. \r = CR \n = LF both = CRLF Quote Link to comment Share on other sites More sharing options...
markm Posted April 5, 2009 Author Share Posted April 5, 2009 OK, done that. They are CR but not CRLF. I guess if I actually need CRLF Filemaker will be stuck, so I got to use Textwrangler to do a Find-Replace on all. Many thanks for your help on this!! Quote Link to comment Share on other sites More sharing options...
AHunter3 Posted April 5, 2009 Share Posted April 5, 2009 You can try this, it might work: a) In TextWrangler, make a document consisting of nothing but a hard return. b) Do a Find and Replace; put \r as the search for, and \r\n as the replace with. c) Copy the results to clipboard; then in Filemaker either paste that into a global text field or else paste it in as the definition (within quotation marks) of a calculation field of result type "text". Let's call this field g.CRLF or CRLF. c) Now define a new calc field also of result type text and define it as Substitute (OriginalField, "¶", g.CRLF) or as Substitute (OriginalField, "¶", CRLF). d) Export THAT field's contents and examine the output in TextWrangler and see if it kicked out CRLF's or if it oh-so-helpfully converted it all to Macintosh (CR only) line endings. Quote Link to comment Share on other sites More sharing options...
markm Posted April 5, 2009 Author Share Posted April 5, 2009 I did some experimentation with your idea, results. To keep it simple I just pasted the CRLF from Textwrangler into a normal Filemaker field and did the Export Field Contents. Results are as follows: \r pasted: Filemaker recognizes as CR in the field and also exports as such \n pasted: Filemaker puts a blank space into the field but exports as CR (weird...) \r\n pasted: Filemaker only puts a CR in the field (no blank space) and exports a CR Quote Link to comment Share on other sites More sharing options...
markm Posted April 5, 2009 Author Share Posted April 5, 2009 when I use the same and use the Export Records Function on the field it gives me \x0B\x0B\r for CRLF I guess the \r is created by Filemaker as the end of the Record, and \x0B is the hex for a vertical tab? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.