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

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

Recommended Posts

Posted

Hi,

I am exporting FMP data into another program which cannot handle any carriage returns. One of the fields has tons of carriage returns in it: some of them are at the end of the text, some in the middle of it, eg.

University of Blah

Department of XYZ

I have tried using the substitute function to replace all carriage returns with spaces, and it works for the ones at the end of the text but not those in the middle.

Can anyone help?? I have already tried the FMP experts email list, but no joy there so far. The only person to respond couldn't understand why returns in the middle of text should be any different to those at the end.

Posted

Hi Jules, What version of FMP are you using? I just tried this on my FM6 and it worked.

Just to check, you are using the par.gif symbol in your Substitute function, right?

Jerry

  • Newbies
Posted

Having two fields

TextWithCR of type text

and

TextWithoutCR of type calculation(text) with this calculation: Substitute ( TextWithCR ; "

Posted

By any chance, it the calculation field set to store the results. Make sure the "Do not store calculations" block is checked.

Mike

Posted

Why? The calculation should work either stored or unstored. The calculation will not remove the carriage return at the end of a record when exported. The text file will have to edited to get rid of those.

Posted

OK, I just ran a test and the calculation storage does not make any difference. However, julesw is having a problem with carriage returns in the middle of the text not at the end. I would understand a carriage return at the end showing up in the exported file because that would be the record delimiter.

Just a thought - are we sure that the "carriage returns" in the middle of the text are in fact carriage returns and not something else like tabs, line feeds, etc. That would explain why the substitute calculation doesn't always seem to work.

Mike

Posted

If other "characters" are the culprit, then change the substitute calculation to include additional criteria like this example using a tab inside the double quotes (copied and pasted in from a text field). You can add more criteria to the substitute function by using the square brackets separated by a semicolon.

Substitute ( text block;[ "

  • Newbies
Posted

How are you exporting? via a text file? There are many ways to remove control characters (tabs, return, linefeed etc) from plain text such as unix programs (sed, awk, perl) or word processors (WordPerfect handles non-printable characters very nicely) or programming editors.

You WILL need a carraige return at the end of each record, so don't simply remove everything at once. I suggest exporting a marker (make a global field with unique text like `EOL` (end of line) and put it at the end of the record. Now you can replace all control characters in your exported file with nothing, leaving you with a monolithic block of text. Then replace all occurences of EOL with a carraige return/newline character.

Posted

okay this is really strange. sometimes it seems to work, sometimes it definitely doesn't. but the character in question is definitely a carriage return, not a tab or multiple spaces.

can't imagine any reason for it work inconsistently??

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