General information
Category:
Coding, syntax & commands
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.)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only