Is there *always* at least 3 colons in each string?
Have you considered using Text to Columns which will parse the string into
segments based on the colon as a delimiter?
Biff
> Hello,
>
[quoted text clipped - 21 lines]
>
> Art.
Art MacNeil - 30 Sep 2006 16:45 GMT
Yes there is always at least 3 colons in each string, and no (D'oh) I had
not considered importing the text file and then parsing it with the colon as
the delimiter.
I have more than 250 text files to do so that seems like a lot of work.
Thanks for the suggestion though,
Art.
> Is there *always* at least 3 colons in each string?
>
[quoted text clipped - 28 lines]
>>
>> Art.
Biff - 30 Sep 2006 19:09 GMT
Here's another formula using the built-in functions that's several
keystrokes shorter:
=LEFT(MID(A1,FIND("~",SUBSTITUTE(A1,":","~",2))+1,255),FIND(":",MID(A1,FIND("~",SUBSTITUTE(A1,":","~",2))+1,255))-1)
Biff
> Yes there is always at least 3 colons in each string, and no (D'oh) I had
> not considered importing the text file and then parsing it with the colon
[quoted text clipped - 38 lines]
>>>
>>> Art.
>Hello,
>
[quoted text clipped - 21 lines]
>
>Art.
Several methods:
It can certainly be done with a formula using built-ins:
=MID(A1,FIND(CHAR(1),SUBSTITUTE(
A1,":",CHAR(1),2))+1,FIND(CHAR(1),
SUBSTITUTE(A1,":",CHAR(1),3))-FIND(
CHAR(1),SUBSTITUTE(A1,":",CHAR(1),2))-1)
You can use a simpler formula if you download and install Longre's free
morefunc.xll add-in from http://xcell05.free.fr/ and then use the Regular
Expression formula:
=REGEX.MID(A1,"[^:]+",3)
You'll also get a bunch of other useful functions, which can be embedded in
your worksheet if it is to be distributed.
Finally, you can select Data/Text to Columns and use ":" as the delimiter.
Then delete the non-relevant columns. This latter could be recorded as a
macro.
--ron
Art MacNeil - 30 Sep 2006 16:57 GMT
>>Hello,
>>
[quoted text clipped - 48 lines]
>
> --ron
Yippee, =MID(A1,FIND(CHAR...) did the trick. I've downloaded the
morefunc.exe as well.
Thanks you,
Art.
Ron Rosenfeld - 30 Sep 2006 21:47 GMT
>>>Hello,
>>>
[quoted text clipped - 55 lines]
>
>Art.
You're welcome. Glad to help. Thanks for the feedback.
--ron