Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

Exported text files have strange return character.


This topic is 6599 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted (edited)

Hi there,

I am exporting records from FMP8 on Mac (Tiger 10.4.8) using either .tab or .csv file formats.

When I then use the command line eg. 'cat testfile.tab' - the data either doesn't appear at all or is read on to a single line - the return characters dont seem to be being read correctly.

For example, I have a test file with 1 field and 3 records where data in each record is 'record1' 'record2' etc.

The outputted text file contains the literal data: -

record 1^Mrecord 2^Mrecord 3^M

Where as it should appear as:-

record1

record2

record3

I have tried exporting in various different file formats but always get the same problem.

I dont have problems reading other text files and can open the files OK and see the data with GUI editors and even Nano.

Any help would be appreciated.

Codeus

Edited by Guest
Posted

When you do your export, you can select different text encodings which will affect which line break character you get. If you are using a Mac, you should probably select Macintosh or Unicode UTF8 or UTF16. OS9 and earlier used control-M (ASCII 13) as linebreaks, but OSX is a UNIX variant, and UNIX uses ASCII-10 as a line break. For that reason, the UNIX CAT command may not recognize carriage returns a line breaks, and is displaying them in the up-arrow escape format "^M". From what I've seen, many Mac applications, to remain compatible, will recognize both ASCII-10 and ASCII-13 as a line break. Have you tried opening the export file in some other application?

Posted

I'm sort of the opposite, more of a FileMaker guy who knows some AppleScript, which sometimes uses Unix command line. The 'do shell script' command in AppleScript automatically converts Unix line endings to old-style Mac ones; you can tell it not to if you need to (often).

There are a couple of Unix commands you could try:

iconv

iconv -l gives you a list of all the formats supported (lots)

textutil (added in 10.4)

not so many formats, but can convert a .doc file to text.

I've not really used either, but they look promising.

Posted

Thanks very much for the reponses. They have set me looking in the right direction and given me some ideas.

Thanks again,

Codeus

This topic is 6599 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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.