Jump to content
Sign in to follow this  
hartmut77

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

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

Share this post


Link to post
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 ".

Share this post


Link to post
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 "

Share this post


Link to post
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 ")

Share this post


Link to post
Share on other sites

In the Find and Replace, use the Find ")" and replace with ") and a capture a return out of a field" instead of the pilcrow

Lee

Share this post


Link to post
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

Share this post


Link to post
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

Share this post


Link to post
Share on other sites

Thanks Lee it worked . I just couldn't see it in Filemaker. Thanks for the help. I still wish I could learn to do this by script. But this solves the problem.

Thanks again

Dave

Share this post


Link to post
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, ")", ")

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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