Discussion:
substring function available?
(too old to reply)
l***@gmail.com
2006-04-13 16:17:42 UTC
Permalink
Hi everyone,

My general problem is this: I'm trying to peel a version number out of
a filename to insert into a text field in my document.

So, I might have a filename "blahblah_v1.2.vsd", and I want to be able
to trim that down to simply "v1.2".

I've been searching and searching for a "substr"-like function to use,
but I can't seem to find anything. The best I could find is REPLACE, so
I've come up with the following function for now:

=REPLACE(FILENAME(),0,LEN(FILENAME())-8,"")

I expected this would trim my example above down to "v1.2.vsd", from
which point I could use a similar function to delete the extraneous
".vsd" extension.

However, after making the change to the shapesheet, my text box on the
visio doc hasn't changed... it's still holding the full filename (which
was my starting point).

Can anyone give me some pointers as to how to proceed? This is my first
shapesheet-editing venture and I'm likely misunderstanding something.

Thanks very much,
Meredith
Chris [Visio MVP]
2006-04-20 19:57:12 UTC
Permalink
Right( Filename(), Len(Filename())-8)?
Mid( Filename(), Len(Filename())-8)?
--
Hope this helps,

Chris Roth
Visio MVP
Post by l***@gmail.com
Hi everyone,
My general problem is this: I'm trying to peel a version number out of
a filename to insert into a text field in my document.
So, I might have a filename "blahblah_v1.2.vsd", and I want to be able
to trim that down to simply "v1.2".
I've been searching and searching for a "substr"-like function to use,
but I can't seem to find anything. The best I could find is REPLACE, so
=REPLACE(FILENAME(),0,LEN(FILENAME())-8,"")
I expected this would trim my example above down to "v1.2.vsd", from
which point I could use a similar function to delete the extraneous
".vsd" extension.
However, after making the change to the shapesheet, my text box on the
visio doc hasn't changed... it's still holding the full filename (which
was my starting point).
Can anyone give me some pointers as to how to proceed? This is my first
shapesheet-editing venture and I'm likely misunderstanding something.
Thanks very much,
Meredith
wouter
2006-05-02 15:43:55 UTC
Permalink
your function will work fine as well Meredith
maybe your were pointing your field to a subshape

Wouter
Post by l***@gmail.com
Hi everyone,
My general problem is this: I'm trying to peel a version number out of
a filename to insert into a text field in my document.
So, I might have a filename "blahblah_v1.2.vsd", and I want to be able
to trim that down to simply "v1.2".
I've been searching and searching for a "substr"-like function to use,
but I can't seem to find anything. The best I could find is REPLACE, so
=REPLACE(FILENAME(),0,LEN(FILENAME())-8,"")
I expected this would trim my example above down to "v1.2.vsd", from
which point I could use a similar function to delete the extraneous
".vsd" extension.
However, after making the change to the shapesheet, my text box on the
visio doc hasn't changed... it's still holding the full filename (which
was my starting point).
Can anyone give me some pointers as to how to proceed? This is my first
shapesheet-editing venture and I'm likely misunderstanding something.
Thanks very much,
Meredith
Loading...