Kieron Posted April 28, 2003 Posted April 28, 2003 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
danjacoby Posted April 28, 2003 Posted April 28, 2003 Obviously, you need to make a choice -- cut words in half or ease up on your "standard length" restriction to accommodate word lengths. 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.
LiveOak Posted April 28, 2003 Posted April 28, 2003 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?". -bd
Kieron Posted April 28, 2003 Author Posted April 28, 2003 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?!
cjaeger Posted April 28, 2003 Posted April 28, 2003 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...)
djgogi Posted April 28, 2003 Posted April 28, 2003 I have posted at fmfiles some time ago this file ftp://ftp.fmfiles.com/download/devhaven/tipstricks/text/FormatLetter.fp5.sit It is a scripted solution, however. Dj
CobaltSky Posted April 29, 2003 Posted April 29, 2003 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.
LiveOak Posted April 29, 2003 Posted April 29, 2003 I would look at the word count for the field and try setting left words at half of the word count. -bd
BobWeaver Posted April 29, 2003 Posted April 29, 2003 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. SplitText.fp5.zip
cjaeger Posted April 29, 2003 Posted April 29, 2003 And yes, apparently I have too much time on my hands. Time is definitely not wasted - thanks for sharing!
Kieron Posted June 6, 2003 Author Posted June 6, 2003 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now