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

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

Recommended Posts

Posted

FMP6 question...

I have a script which sets a field to a particular character string with a length of 235 bytes on each record, plus one carriage control. The script then exports that field for the found record set. I export that to a ".dat" named file using tab as a filetype (as there are no other options close to .dat).

It appears as though filemaker adds an extra byte to each record (237 bytes per record). This file is being fed into a very specific dos based program where the extra bytes cause errors. The same thing happens even if I create a .txt file, so I'm fairly certain something is occurring during the export step.

Any thoughts on what FileMaker may be doing and how I can resolve it?

Thanks in advance!

Posted

Just a guess, but it may be the old CR/LF cross-platform problem.

Posted

Two things come to mind:

1. You say there are 235 characters in the string, plus one carriage control (whatever that means). That makes 236. When the found set is exported, Filemaker inserts a Carriage Return character at the end of each record (Carriage Returns in field contents are converted to vertical tabs). So that would make 237.

2. When you export, you are presented with an option to choose a character set. That's what Vaughan was referring to - IIRC, the Windows set inserts BOTH Carriage Return AND Line Feed characters at the end of each record.

To get to the bottom of this, export someting like 3 records of "aaa" each, then open the file in a text editor that can show and identify non-printing characters. Surely there must be some Windows app that can do this.

Posted

I've tried this. No matter what character set I select (windows, dos,Mac), I still get 1 extra byte per record. I set a field to be "aaa", export 2 records and get a file with 10 bytes (which should be 8 when you account for the CR). Are you saying if I use FileMaker on a Mac this would act differently?

Posted

I think Vaughan is correct. Look at the record in a hex editor, or text editor that can display hex. If you don't have one, attach a subset with 1 record, and I'll look at it for you.

FYI, on PCs a CRLF is '0A0D' hex.

Steve

Posted

It could be different on a Mac - I have just exported 2x "aaa" both in Mac and Windows character sets and the two files are identical, each having 8 characters.

I don't see a way to move forward on this until you identify the extra characters.

Posted

I viewed my file in a hex editor, I have aaa, then CR, then LF. (61 61 61 0D 0A)

Any thoughts on how to control the CR & LF from FileMaker? Ugh! This dos-based pgm the file is being fed into can't handle both a CR and LF.

Thanks for the help.

Posted

Oh, and the CR (0D) is the character I need to omit. Sigh. Do I have any hope or do I need to find yet another program to edit my file with?

TIA,

Heather

Posted

Hi Heather:

You can't stop FM from putting out the CRLF, altho maybe one of the other text-based file formats may not give you a problem. Best bet would be to use a text editor and globally search for and change the 0A0D to 0A.

I used Edit Plus++, which will do the trick. There may be some freeware (or shareware) editors that will also work.

Steve

Posted

You could also try exporting as XML, with an xsl stylesheet. There is default separator in xsl really, so you can specify whatever you want. It's easier to do in 7, since you can see and edit the File References directly, but xml is supported in 6 also.

There's a little bit of a learning curve. But if you're just trying to export a few fields it should not be too bad.

Posted

It appears that you are looking for a unix type file format, because unix text files use a linefeed only as the end of line character. There is a utility floating around called dos2unix that will do this. Do a google search for dos2unix.

Here's one link:

http://www.freedownloadscenter.com/Utilities/Misc__Utilities/DOS2UNIX_UNIX2DOS.html

Or if you have perl on your computer, you can fix the file with a one line command:

perl -pi -e 's/rn/n/;' myfile.txt

You could execute either the perl command or the dos2unix command using a send event script step immediately after the file is exported.

This topic is 7113 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.