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

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

Recommended Posts

Posted

I need to cut a large piece of text into multiple standard lengths. I can use the calculation functions 'Left and left word', but 'left' can cut words in half , and 'left word' cannot make a standard length of line.

Any suggestions?

Kieron

Posted

Obviously, you need to make a choice -- cut words in half or ease up on your "standard length" restriction to accommodate word lengths. wink.gif

OK, that's the flip answer; now the long one. Set up parameters to determine how long the line would be for various "LeftWord" factors in order to decide how many words to use in each line.

Posted

The way you have stated the problem, it doesn't have an answer. You can either have a standard length OR not cut words in half. How can you do both without editing the text?

How about telling us what you are REALLY trying to do? Instead of "How do I force a cylindrical piece of metal with one flat and one pointed end into dried plant material?", we need "How do I build a house?". wink.gif

-bd

Posted

To explain:-

If I have a string of 400 words and I need to split it. I could either split it with the 'left' function or the 'left word' function. If I split it with left I could break a word up. If I use the left word I could end up with a set of words which is only 10 characters long. I need the length of the string of characters to be roughly between 60 and 70 characters in length.

Does that make more sense?!

Posted

Hey, guys, this IS a common problem. In many email programs you better restrict lines to below 80 chars ...

Does anyone has come up with an answer yet?

I do it with looping scripts, but there must be a better way (a calc...)

Posted

Hi Kieron,

If I understand you correctly, you are wanting to break the text up into multiple components, which contain the maximum number of words which will fit within a specified character lenth. In other words a form of 'intelligent' parsing.

I also assume that you'd prefer to achieve it by calculation if possible. That being the case, you might also like to take a look at a calculation formula which is included in the following download file:

http://www.nightwing.com.au/FileMaker/demos/PrintSelect.zip

The calc in question divides a line into two at the nearest word break to a line length (where the line length is a user specified value in a global field).

Although the demo calculation only divides a string into two (and places them on either side of a carriage return in the same field), the principle could readily be adapted/extended to divide the input string into more than two parts, and/or to distribute the parts to multiple separate fields. cool.gif

Posted

In the past, I have done this using a script, but I was curious if there was a way to do it by calculation only. So, I tried an experiment with partially successful results. The result doesn't look as good as a scripted method, but it does sort of work. The line length is somewhat variable. I have attached the file, so you can compare the results.

And yes, apparently I have too much time on my hands. grin.gif

SplitText.fp5.zip

Posted

And yes, apparently I have too much time on my hands. grin.gif

Time is definitely not wasted - thanks for sharing!

  • 1 month later...
Posted

Thank you all for your help and ideas.

I have had to go down the scripted version as the calculation just becomes too unmanageable for my head!

Kieron

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