Hello all,
I'm not sure if python can do something like this. Our brains can do it so maybe we can get an automated way to do this?
I need to give a page number to each of these pages. They need to be in an order like below, based on the grid name. It's like township name, then some of them have a section detail page (11-1), and then some of them further have a subsection detail page (11-1NE - northeast part of section 1 in township 11). I have 275 pages in this set. In the past I have to do it manually. Does anyone have any ideas? Thank you.
1
2
3
4
5
6
7
8
9
10
11
11-1
11-1NE
11-1NW
11-1SE
11-2
11-2NE
11-7
11-8
11-10SW
11-12NE
Solved! Go to Solution.
Runtime error Traceback (most recent call last): File "<string>", line 34, in <module> ValueError: invalid literal for int() with base 10: '49 & 49A'
Ok, I cleaned up the spacing in PyScripter. It does work on a subset of my data!
But I have really messy data in here. Like "49 & 49A" and "51A", among other names. Maybe there can be some code that just says to ignore those if it finds them? Because I'll have to do those manually anyway based on the old book order.
Thank you!!
Sure, you can play around with .replace(). This will replace all " & " with "-", stored in variable newString:
... for row in cursor: newString = row[1].replace(" & ", "-")