April 28, 200322 yr 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
April 28, 200322 yr 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.
April 28, 200322 yr 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
April 28, 200322 yr Author 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?!
April 28, 200322 yr 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...)
April 28, 200322 yr 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
April 29, 200322 yr 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.
April 29, 200322 yr I would look at the word count for the field and try setting left words at half of the word count. -bd
April 29, 200322 yr 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
April 29, 200322 yr And yes, apparently I have too much time on my hands. Time is definitely not wasted - thanks for sharing!
June 6, 200322 yr Author 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
Create an account or sign in to comment