Jump to content

Extract lines of text from field?


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

Recommended Posts

If I have a field called "items" that contains for example:

Plant

Tree

Grass

Weed

I want to have different calc fields, one each for each line of text in "items" that will extract that line.

field "calc1" = "Plant"

field "calc2" = "Tree"

field "calc3" = "Grass"

field "calc4" = "Weed"

and

field "calc5" = ""

because there is no line 5 of text in "items."

Is something like this even possible?

LR

Link to comment
Share on other sites

I guess what I was trying to drive at with number 5, but did so poorly...

My text field will not ALWAYS have 4 lines of text. Sometimes it might have 5, sometimes 3, sometimes 4.

The above calc...Only works if the last line (4) has a carriage return after it. Otherwise line 4 does not show up in the calc.

LR

Link to comment
Share on other sites

Thanks for the help...

Three things that I see:

1) Using the above formula, If I have 5 lines of text, the fifth calc field does not pull out the text from line 5 unless line 5 has a carriage return after it.

2) If line 5 DOES have a carriage return after it, then the calc5 field does pull the text out from line 5, but then calc3 all of a sudden does NOT pull the text out for line 3.

3) And just in case the field only contains 4 lines, again, unless a carriage return is placed after line 4, the calc4 does not work.

LR

Link to comment
Share on other sites

Sorry, did not follow that last post. My final posted solution was copied from my FM file that seems to work.

1) If the only data that exists is a single line in the field "items" then calc1 grabs that line of text.

2) If there are two lines of data in field "items", line one followed by carriage return and line two...then cal1 one grabs the info from line 1 and calc 2 grabs the info from line 2.

3) If there are 4 lines of text seperated by carriage returns in field "items" it still seems to work. calc1, calc2, calc3 and calc4 all grab information from their respective lines frome field "items"

4) And calc5 seems to work if there are 5 lines in field "items." each of my calc fields grab the appropriate information from the associated line in field "items."

So it seems to be working for me. In any case, thank you SO MUCH for your help. There is no way I could have got it to work. That is a a piece of work you came up with there.

LR

Link to comment
Share on other sites

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