Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

parsing long lines

Featured Replies

Hi people:

I need to parse several fields with long text lines. Each line should have a maximun of 40 chars. Here is a sample:

Multiple moles mainly on his back with

regular borders, flat, ranging in color

from pink, light brown to dark brown.

pin rom pink, light brown to dark brown.

pink keloid on left scapula, 2cm in

diameter keloid on left scapula, 2cm

in diameter

I created a calculation, but it does not work for all the cases that the text might have in terms of number of chars.

Case(

Round(Length( GeneralSkinCom.t )/40,0)>=2 and Round(Length( GeneralSkinCom.t )/40,0)<3,

Middle(GeneralSkinCom.t,1,40) & "

It looks like you are assuming that a space will occur every 40 characters. I think that is a bad assumption. You need to check where spaces occur and pick the ones that are 40 characters or less from the start of the line. This looks more like a script than a calculation.

I think I would use 2 fields to hold the text while working the script. One would contain the result and the other would hold the text to be parshed. When the break point is found add the left part to the result and use the right part as the text to be parshed.

  • Author

Thanks RalphL for answer question.

I think that I have not explain myself enough about the problem. The calculation intents to print the content of the field in a section of a report. It only allows to print 40 chars (wide). The calculation needs to add the content of several text fields. I tried adding the fields in the report but because some are longer than others it does not print well.

Thanks again,

Mary

Hi Mary,

Take a look at these two files by Bob Weaver.

Contain Length of Line

Here

Count Lines of Wrapped, Styled, Non-monospaced Text

And Here

HTH

Lee

cool.gif

Mary,

I think I understand what you are trying to do. I put together a sample file with a script to parse the text sample. It looks like this:

Multiple moles mainly on his back with regular

borders, flat, ranging in color from pink,

light brown to dark brown. pin rom pink,

light brown to dark brown. pink keloid on

left scapula, 2cm in diameter keloid on left

scapula, 2cm in diameter

Just wondering: why cannot the text box itself be shrunk (in Layout mode) so that no more than 40 characters fit on a line?

I like Bob's Contain Length of Line sample, but I would use a value list sorted by a second Index field that is a lookup of the global Index, instead of hard-coding concatenation of the repetitions.

  • Author

Thanks people for all the help that you have offered.

I do not want to place the field in a layout, range it until 40 char because a) There are 100 fields - in the same table - where the parsing process should be done.

: I did that before and when the text exceed the field long, the text was cut (you can hear the users complains)

The scripts will not work either. The time to process 100 fields will make my users complain (again)

Somebody sent me the following answer from another website.

http://www.maclane.com/cgi-bin/ultimatebb.cgi?/ubb/get_topic/f/2/t/002039.html#000002

It is a calc solution.

I have not try it, let see how it works.

Thanks again,

Mary

Makes me wonder if you looked at the files by Bob Weaver that I pointed you to?

  • Author

Yes, Lee. I looked them. Thanks for send the links. They refer to scripts solutions and I need a calculation.

Thanks

Mary

No, there are 3 approaches in the SplitText.fp5. Only 1 is a script, and other two are calculations.

That is why I asked. Look at the labels on the buttons, they take you to the different views, and there is a short note on each layout telling you what you are looking at.

Lee

wink.gif

Mary:

You say that you "did that before and when the text exceed the field long, the text was cut (you can hear the users complains)." No, the text should just wrap around, with nothing cut. In addition, you could use a mono-spaced font.

  • 4 weeks later...
  • Author

Hi Everybody:

I finished the calculations to parse the text fields (264!!). The report runs beatifully...

Thanks very much for all your help!!

Mary

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.