Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Odd string replacement: STRTRAN but with embedded spaces
Message
From
14/11/2006 10:57:49
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01169359
Message ID:
01169494
Views:
8
Mike -- no problem there.

Their problem is that they need the product description and UPC Codes to appear on certain reports and labels generated by their system, and these reports and labels only show the product description field. Since they can't (or don't know how to) modify these reports, they schmooshed the fields together. (I guess it might also be that there were too many places that would need changes.)

>I don't have the silver bullet you want but will observe that this is an object lesson in proper data normalization. (Yes, I know, it's your customer who Bozo-ed it up). Part description and UPC code are two attributes, not one. Smooshing them together into one field -- why?! -- was asking for trouble.
>
>Sorry you're the one who got left holding the bag.
>
>
>>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.)
Jim Nelson
Newbury Park, CA
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform