Jump to content
Salesforce and other SMB Solutions are coming soon. ×

ASCII CRLF delimiting


markm
 Share

Recommended Posts

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)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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...

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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!!

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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?

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use