Select to view content in your preferred language

substrings of path dynamic text

549
2
Jump to solution
03-13-2012 02:00 PM
MattMillard
Emerging Contributor
For an mxd that has the file path as dynamic text, is it possible to extract one or more substrings of characters from either the full path or the document name, and assign the substrings to variables to be used to populate text strings elsewhere within the mxd? I'd prefer to do this within an open mxd.

Thanks

Matt Millard
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
BruceNielsen
Frequent Contributor
You should look at the methods that are available in the os.path module. Their purpose is for parsing and manipulating file and folder path strings.

View solution in original post

0 Kudos
2 Replies
BruceNielsen
Frequent Contributor
You should look at the methods that are available in the os.path module. Their purpose is for parsing and manipulating file and folder path strings.
0 Kudos
StephenBarrow
Emerging Contributor
The string module allows you to search for substrings.

os.path.basename and os.path.dirname will break up the mxd name and path.
0 Kudos