Jump to content

how to add a space in an if then text calculation?


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

Recommended Posts

Hello

I have a test field -Field "A"- that has faulty data entered into it. ( it is not always in the same structure)

The problem is : Sometimes the 10th paragraph return has a parenthesized 5 digit zip code at the end of a phrase --like County : Madison : (13421)

and In this case I would like to add a BLANK SPACE as the 11th paragraph return and move down everything a single paragraph return

If the 10th paragraph does NOT have a parenthesized 5 digit zip code at the end of the phrase i would like to do nothing

Example (this is what I would like to script IF the 10th paragraph contains a parenthesised zip code at the end of that line -just add a space after it that doesn't presently exist...)

xxxxxx

xxxxxx

xxxxxx

xxxxxx

xxxxxx

xxxxxx

xxxxxx

xxxxxx

xxxxxx

xxxxxx (13567)

xxxxxx

xxxxxx

Could someone tell me how to do this?

Thanks

Dave

Link to comment
Share on other sites

test if the text between position(" par.gif ",9) and position(" par.gif ",10) is >999 or 9999 (if 01234 is a valid zip) and has patternCount(, "(") and patternCount(, ")") both>1. then replace() position(text," par.gif,1,10) with " space par.gif ".

Link to comment
Share on other sites

Hi hartmut77,

I'm not sure that I'm completely following you, (Do you want a paragraph return after the ")" or a space?) I'm going to assume that it is a Paragraph Return "

Link to comment
Share on other sites

Thank you for your help

I tried to use the find and replace in filemaker but it will not let me add a pilcrow like a word processor.

In that case I would like to find the occurence of

)^pL and replace with )^p^pL but I don't think I can do this with the find/replace command.

As far as scripting- I am looking for the same thing

In the field "A" looking for the occurence of ")

Link to comment
Share on other sites

Lee - I tried it an it didn't work for me.

I am on a mac if that makes any difference.

In the find and replace I looked for the ")"

and the replace I typed in the same but copies the return out of the field and it doesn't seem to work.

Dave

Link to comment
Share on other sites

I'm on a mac also, hence the apple logo I always use in my replies. smile.gif

Type this in a field (that's what I did):

)

This equals " ) and a Paragarph", and then copy it and paste it into the Replace box

Lee

cool.gif

Link to comment
Share on other sites

Oh, but you can do it by script and you can do it directly by using the Replace under the Menu as I stated before. In fact, before FM version 6, it would have been the only way. You want to use the Substitute calculation function. In a script, you can do this with either the Replace or Instert Calculation steps (choose one) when you get to the "Specify Calculation" box, use this calculation naming the field you have the ")" in now:

Substitute(YourFieldNow, ")", ")

Link to comment
Share on other sites

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