ibiubu Posted June 8, 2004 Share Posted June 8, 2004 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 More sharing options...
dbruggmann Posted June 8, 2004 Share Posted June 8, 2004 The following works for a five line text field, where the lines are separated by a carriage return ( Link to comment Share on other sites More sharing options...
ibiubu Posted June 8, 2004 Author Share Posted June 8, 2004 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 More sharing options...
dbruggmann Posted June 8, 2004 Share Posted June 8, 2004 Sorry ibiubu I stand corrected, the formula for the fourth line in a four line field should be: field "calc4" = Middle(items & " Link to comment Share on other sites More sharing options...
ibiubu Posted June 8, 2004 Author Share Posted June 8, 2004 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 More sharing options...
ibiubu Posted June 8, 2004 Author Share Posted June 8, 2004 OK, here is what worked for me... If(PatternCount(items, " Link to comment Share on other sites More sharing options...
dbruggmann Posted June 8, 2004 Share Posted June 8, 2004 Never post a text function, unless you tested it Link to comment Share on other sites More sharing options...
ibiubu Posted June 8, 2004 Author Share Posted June 8, 2004 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 More sharing options...
dbruggmann Posted June 8, 2004 Share Posted June 8, 2004 The testing phrase referred to my own formulas, I didn't want to criticize yours! Our last posts just crossed one another Link to comment Share on other sites More sharing options...
Ender Posted June 8, 2004 Share Posted June 8, 2004 The " " symbol can be written as ">=" in calcs or in the forums. There are also symbols available in the instant graemlins just for posting. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now