Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd string replacement: STRTRAN but with embedded spaces
Message
From
13/11/2006 18:56:33
Charlie Schreiner
Myers and Stauffer Consulting
Topeka, Kansas, United States
 
 
To
13/11/2006 18:26:27
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01169359
Message ID:
01169360
Views:
10
CHRTRAN() allows you to remove any character (or group of characters).

>I have an odd problem which is not quite handled by STRTRAN, and I'm looking for suggested approaches to the problem. (Tain't a big problem, but sometimes it helps to see how others think of things).
>
>My problem is that my customer has a field (in their database, not one I have any control over), in which they combined two fields -- part description and UPC code. They also have another field for the UPC Code (12 numeric). I need to extract just the part description, deleting the UPC Code.
>
>The difficulty arises because the UPC Code in this combined field frequently has embedded spaces (UPC Code might be "112345123451", and the combined field might read "Small Widget (1 12345 12345 1)"). As usually happens, most of these are entered the same way, but not all -- and there are quite a variety of ways used to embed the extra spaces.
>
>So, how do I go about doing this STRTRAN-equivalent? (I note that I can tell IF the UPC Code is in the combined field by removing all spaces from the combined field and then using $ ... but this doesn't tell me how to make the replacement. I also should note that sometimes there are multiple consecutive embedded spaces.)
Charlie
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform