Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I have a text block field which contains lines of text separated by carriage returns and I was wondering if it was possible to remove all carriage returns that do not contain any text on a line.

CR.jpg

Thank You for any thoughts on the matter.

Posted

If your field is called OriginalText, then this calc might do what you need. It works in v10. I'm not sure when TrimAll() introduced.

Substitute(

Substitute(

TrimAll(

Substitute(

Substitute(OriginalText; " "; "__SPACE__");

"¶"; " ");

0; 0); " "; "¶"); "__SPACE__"; " ")

Posted

If you know that the number of blank lines is relatively small, you can use the simpler

Substitute(OriginalText;

["¶¶¶¶¶¶¶";"¶"];

["¶¶¶¶¶¶";"¶"];

["¶¶¶¶¶";"¶"];

["¶¶¶¶";"¶"];

["¶¶¶";"¶"];

["¶¶";"¶"]

)

Posted

Neither one seem to work for me.

The calculated field showed the same result as the original text field.

Thank you. I'll keep at it.

Posted

Check into the possibility that the problem in the field isn't that there are blank lines from the user hitting the Return key, but the blank lines are due to the user hitting the SPACE bar so that the next visible text starts on a new line in the box.

Last year I had to clean up a customer's database where that was the case. Instead of putting multiple phone numbers on separate lines with Return, the user hit the space bar multiple times after the first phone number before entering the second.

Posted

Now the method suggested should at least give a change in the result, and there is a more clever algorithm for this purpose.

But perhaps you should attack the matter differently, since these does usually originate from a scripts deeds, and my prefered way to avoid it is for setting as well as the riddance of an element in such a list is to exploit this CF:

http://www.briandunning.com/cf/39

The function simply toggles on and off for each value...

--sd

Posted

Neither one seem to work for me.

The calculated field showed the same result as the original text field.

Thank you. I'll keep at it.

That's impossible.

At this point it would be helpful if you upload a file so we can see how you're doing this.

Posted

Definitely the return key I tested it in my sample file. Would platform have a factor? mac vs pc?

Posted

No, platform is not a factor. Entering the calculation correctly does make a difference.

The substitutions should have a simple pilcrow or a series of pilcrows and no special character preceding the pilcrow. Methinks your browser and/or your copy-paste functionality has thrown a monkey wrench into the works.

Posted

Boy do I feel dumb :-(

Correct calcs make all the difference.

Both worked just fine.

Thanks a million!!

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