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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Replacing codes in mass 1

Status
Not open for further replies.

wamiste

MIS
Jan 16, 2005
1
US
I am a begginer on this and I would appreciate your help.
I would like to know how to change in mass (one pass) my inventory file for specific criteria. here are the examples:
.- Have many numbers like this:
120XP, 1433XP, 340XP, 34543XP etc.
.- I would like to remove the "XP" from above group in mass to be changed to:
120, 1433, 340, 34543
.- I would start something like this
a) Use inventry excl
b) copy to inventry.bk
c) repl all codes with ?????? for vendor="TTH"
FYI, vendor="TTH" groups the codes that I would like to change.
I have spent a couple of hours trying to accomplish my task using the trim command without success.
Your promtp reply would be appreciated.
Thanks,
Wamiste
 
use inventory excl
copy to inventory.bk && Make backup copy of data
replace all codes with iif("XP"$codes,stuff(codes,at("XP",codes),2,""),codes)for vendor = "TTH"

This assumes "XP" is the only string you need to replace and you know it's always uppercase. If you needed to replace a string say "XPA", be sure to change the 2 to a 3 as this determines how many characters get removed in the STUFF function. Tested this briefly on samples you gave, my need adjustment if your data is more complex.

HTH
Dennis
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top