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

Delete all words up to a certain string, etc

Status
Not open for further replies.

NavyFederalDetta

Technical User
Mar 22, 2006
16
I would like to delete all words up to the word "Barcode" and after the 6 digits that follow.
Ex:

"text string describing equipment
BARCODE 123456

Used for description of items"

I have been playing with this formula:

Replace ({POLN.FREEFORM},"BARCODE","")

Obviously it needs an "Upto" command of some sort then an "after" command.
This is a freeform field so the data will almost always be different.

Thank you!!
 
Rather than delete, extract, as in:

mid({table.field},instr({table.field},"Barcode"),14)

-k
 
Thank you!! this was perfect:

if "BARCODE" in {POLN.FREEFORM}
then mid({POLN.FREEFORM},instr{POLN.FREEFORM},"BARCODE"),14)
else ""

Then, I used that formula (@Barcode)to write a second:

right ({@Barcode},6)

This gives me just the 6 digit barcode number.
I was definitely on the wrong track and you steered me right. :)

Thanks again!!!

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top