how to detect a ( , )

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Jmac2501
Pro Scripter
Posts: 76
Joined: Tue Nov 15, 2005 8:11 pm

how to detect a ( , )

Post by Jmac2501 » Fri Jun 18, 2010 5:17 am

I have to make folders out of addresses and want to seperate the address like this:
From this - 12345 1st St, Sacramento, CA 95817
to
this - 12345 1st St
Deleting everything after the ( , ).
I have a scrip but its not working.

Code: Select all

  let >y=1
  let>address=12345 1st St, Sacramento, CA 95817 
  label>ADD
    let y=y+1
   MidStr>%address%,%y%,1,add2
     if>add2=(need to know how to make is see the , here),ADD1
       else
       goto>ADD
       endif
label>ADD1

User avatar
Marcus Tettmar
Site Admin
Posts: 7391
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Post by Marcus Tettmar » Fri Jun 18, 2010 7:24 am

Hi,

I would do it like this:

Let>data=12345 1st St, Sacramento, CA 95817
Let>comma=,
Separate>data,comma,parts

Now parts_1 contains 12345 1st St
parts_2 contains Sacramento
parts_3 contains CA95817
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?

Jmac2501
Pro Scripter
Posts: 76
Joined: Tue Nov 15, 2005 8:11 pm

Post by Jmac2501 » Fri Jun 18, 2010 1:20 pm

awsome thanks

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts