UTF 16 to MAC linefeed ?

Trying to import in FMP12 an UTF-16 with UNIX LF plain text file through TextWrangler every LF converts to a CR and as such as a new record.

How to to avoid this?

Selecting the various paragraphs and asking TextWrangler to convert “\r” to “\n” gives no results and FMP keeps separating the selection with CRs

Thanks for any assistance

Why using textwrangler?

Thanks and Happy New Year

I use textWrangler as I import my data from my Samsung Phones. The application doing this returns text files. They all have pretty much the same format however if I want to import into Filemaker12 the SMS messages if in the message there are Carriage returns they will become New Records and to fix this is complex.

the files (all in UTF16) are as follow

timestamp (tab) from_to (tab) phone_Num (tab) SMS

so the last part is troublesome as explained previously,

I am not very skilled with Apple script however TextWrangler allows me to modify the various files much better than text edit, still I am unable to create an “import File” which will smoothly go to the FMP

Thanks

Hello.

If you save the files with Unix Linefeeds in Text Wrangler, then you’ll have to configure your FileMaker import if possible. You better read the documentation for what kind of UTF-16 Filemaker accepts and adjust accordingly in Text Wrangler, that is, if that is the issue. Big Endian / Small Endian, and Bom/NoBom. Text Wrangler can do it all.

Edit

If you don’t succeed in making FileMaker keep the Linefeeds, then maybe you could just convert the linefeeds into return in TextWrangler?

I’m with McUsr but there are two more things I would try:

  1. Check if fmp12 can handle text indicators. Then you should wrap the sms messages in double quotes and double quotes should be replaces with 2 double qoutes.
  2. Replace the return in the sms message with a non printable character like a device control of form feed character and replace that back after import?

The problem you mention is not AppleScript related so we have to find a solution first that we can work out in AppleScript later.

Filemaker wants a CR to indicate a new record. I would pre-process the text files to replace at least all LF (ASCII 10), VT (ASCII 11), and ASCII 29 (used to delimit repeating field values in FM) to other importable literal characters or strings such as “[[LF]]” which can then be substituted for in FM as desired.