Jump to content

Replace calculation in text block


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

Recommended Posts

  • Newbies

Looking for a way to do this.

Here’s the simple explanation.

F1- One field has a 5 letter code (‘DW009’)

F2 -Another field has a block of text (“Please delete ‘AB009’ and then quit”) that is the same on every record

There is a code in the block of text(‘AB009’) that I want to replace with the code from each of the F1 fields.

Couple of things.

There are 150 records to change.

The block of text is much bigger and is actually a SQL query that needs to be specific to each code in field 1 (F1).

I was thinking of a calculated Replace but it started getting ugly fast.

The calc would be: Go get the code in F1 and replace this text “DW009” with F1’s field contents.

This would either be a replace or calc with a script to loop through the records.

I then have to export out the contents to a master text document ….or individual text docs if I have to.

Any recommendations?

Link to comment
Share on other sites

Assuming all occurrences of "‘AB009’" in F2 should be replaced, try a calculation field (result is Text) =

Substitute ( F2 ; "‘AB009’" ; F1 )

To replace the actual content of F2 would require either a looping script or running Replace Field Contents… with a calculated result using the same formula. Make sure you have a backup if you go that way.

Link to comment
Share on other sites

  • Newbies

Assuming all occurrences of "‘AB009’" in F2 should be replaced, try a calculation field (result is Text) =

Substitute ( F2 ; "‘AB009’" ; F1 )

To replace the actual content of F2 would require either a looping script or running Replace Field Contents… with a calculated result using the same formula. Make sure you have a backup if you go that way.

Looks like that does it. Thanks!

Link to comment
Share on other sites

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