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

How to find out the position of strings

Status
Not open for further replies.

Enea

Technical User
Feb 23, 2005
90
US
My field looks like this:
USA/NYC/55Madison/3
CANADA/TOROR/123MAIN/14

I need to separate each piece of information between / into separate columns.

How do I do in this case?
 
II think you will have to build it up by creating a number of variables:

l1=(left(fld,pos(fld,"/")-1) will give USA

r1=(substr(fld,pos(fld,"/")+1,99) will give /NYC/55Madison/3
l2=(left(r1,pos(r1,"/")-1) will give NYC

r2=(substr(r1,pos(fld,"/")+1,99) will give 55Madison/3
l3=(left(r2,pos(r2,"/")-1) will give 55Madison/

r3=(substr(r2,pos(fld,"/")+1,99) will give 3

This is theory only - I have not tested it
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top