Hi Everyone,
I'm trying to create a nice road index for a map. One that looks like the screenshot below. However, I can't figure out how to create the index so that my road name listed has periods filling in the remaining space before the index cell is listed.
So far, I found some examples of python to use but nothing specific to how to enter it into the field calculator in ArcGIS Pro. The table shows my two fields, one with the street name, the other with the index cell it falls in on my map.
Any help is appreciated!
Solved! Go to Solution.
Hello @JM32 , something like this will work in the Field Calculator without a Code Block if you prefer.
!COUNTRY!+("..............."[:(15-(len(!COUNTRY!)))])+str(!MYINT!)
@ChrisUnderwood This worked, but the result is the same as above where I get uneven columns. The first screenshot in my initial post is my goal. I'd like to have the road names listed, and then have dots until the index cell is listed, but have them all line up together. Hopefully this makes sense!
perhaps a monospaced font would have to be specified, which is probably an unlikely case for field calculations.
Success! So, the solution is from both @TonyAlmeida and @DanPatterson
Below are screenshots of the results and field calculator expression used.
The expression allowed for me to set a number for how many dots I'd like with the remaining space in a given text field. After running it, I still had alignment issues. However, I switch to a monospaced font (Courier New) and everything aligned perfectly! I plan to use this to create the final road index I'm making for a street map.
Thank you everyone for your help!
Jon