Separating string

Technical support and scripting issues

Moderators: Dorian (MJT support), JRL

Post Reply
CZ
Newbie
Posts: 18
Joined: Wed Feb 07, 2007 7:51 am

Separating string

Post by CZ » Mon Aug 04, 2008 6:00 am

Hello I am trying to manipulate a string in a cell in Excell so that I can select the first portion of the string in Excel before the word "by" and then paste it into another cell and then select the second portion after the word "by" and put it in another cell in Excel. Here is an example, in this string "**515. 100 Years by Five for Fighting" I am trying to first of all select the "**" and then the "100 Years". Then combine those 2 together to look like "**100 Years" and deleting the number "515." I then place that in a cell in Excel. I then select the "Five for Fighting" which is after the word "by" and place it in another cell in Excel. I was able to come up with some of it, except I am having problems with figuring out how to cut off the word "by" and the leading and following space after the word "by" as well as the string after the word "by".

This is what I came up with so far:


MidStr>**515. 100 Years by Five for Fighting,1,2,start
Position>by,**515. 100 Years by Five for Fighting,0,StartPos,true
MidStr>**515. 100 Years by Five for Fighting,8,StartPos,position
Message>%start%%position%

Any help would be greatly appreciated.

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

Post by Marcus Tettmar » Mon Aug 04, 2008 7:14 am

I'd use Separate. Maybe this will help:

Code: Select all

Let>string=**515. 100 Years by Five for Fighting
Separate>string, by ,parts
MessageModal>parts_2
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar

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

CZ
Newbie
Posts: 18
Joined: Wed Feb 07, 2007 7:51 am

Separating string

Post by CZ » Mon Aug 04, 2008 11:02 pm

Thank you for that quick reply. It works great. Thanks again.

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