Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: prasmussenHere you go:
1st Bullet
text="ABD (Rear) and DEF (Rear Sample)"
nText=text
while nText.strFindI("(") > -1
{
fParenthesis=nText.strFind("(")
sParenthesis=nText.strFind(")")
offset=sParenthesis - fParenthesis
vText=nText.substr(fParenthesis-1,offset+2)
nText=nText.replace(vText,"").trim()
}
emit text,nText
2nd Bullet
text="Sample 1/3, Floor U/G, Block extra"
searchString="Block"
foundString = text.strFindI(searchString)
if foundString > -1 then nText=text.replace(text.substr(foundString,text.st rlen()),searchString)
emit text, nText
On the 2nd bullet, you could put the search string in a list and loop through it as well for a list of words:
i=0
text="Sample 1/3, Floor U/G, Block extra"
searchList=list("Block","AnyValue")
while i < searchList.len() {
foundString = text.strFindI(searchList[i])
if foundString > -1 then nText=text.replace(text.substr(foundString,text.st rlen()),searchList[i])
i=i+1
}
emit text, nText