Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacing a String with blnak if it exists in another field

Status
Not open for further replies.

edrossi

Programmer
Jan 24, 2002
42
US
Here is what i am trying to accomplish


Field1 Field2

123 Main St #150 #150
2235 Main St #134 134 REAR

Results should be:

123 Main St #150 blank
2235 Main St #134 REAR

Any help is appreciated
 
edrossi

Just thinking about the possibilities gives me a headeache. Fuzzy logic is difficult to code.
1. If the number contained in field 2 is also contained in field 1 remove it. But what if the street address is also the same.
2. I assume the number you are looking for is not always 3 digits.
3. What about 123 Main north #123 ?

The possibilities could be endless. I guess take the lowest common denominator, and work with that. Take the number from field 2, store it in a variable, and check to see if its in field1, if it is blank the field. And what kind of result that gives you. Backup your data before.
Mike Gagnon

If you want to get the best response to a question, please check out FAQ184-2483 first.
 
This is what I am going to try and do, the part I am missing is how to check and see if filed2 exists in field 1
 
? <search_for_string> $ <search_in_string>
So in your case,

? field2 $ field1


This will return .T. if field2 is contained within field1.

If the character expression isn't found, false (.F.) is returned. The $ operator is case-sensitive and is not Rushmore optimizable.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top