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!

Parsing out text

Status
Not open for further replies.

Palmbak

Technical User
Dec 17, 2002
25
US
03/15/04 - LL58781: BRYANT ODELL; M5 120 W 56 ST to QUJ

Im trying to pull the following information out of the text above "M5 120 W 56 ST to QUJ"

I can't use the right/left function (same for mid) because the length won't always be the same. Is there a function I can use that shows everything past the ";"?


Thanks in advance...

Jon

Jon Palmbak
Business Analyst
 
This should do it:

trim(right({Table.Field},len({Table.Field}) - instr({Table.Field},";")))

Of course, you might want to use the Instr function to verify that a semicolon exists first.

-dave
 
Hi Jon,

If you always have "; " before the required text then use something like:

Split({your_field}, "; ")[2]

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Much cleaner, Ido. The only potential problem with that is if the string past the first semicolon contains another semicolon.

-dave
 
Dave, you are 100% correct (though I believe your solution would run into the same issue).

Jon, if that is indeed an issue, let me know and I'll provide a slightly more complex solution.

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top