-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuiBatchSplit.py
More file actions
31 lines (26 loc) · 828 Bytes
/
Copy pathuiBatchSplit.py
File metadata and controls
31 lines (26 loc) · 828 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
__author__ = "Martin Lacayo-Emery <popanalyst@gmail.com>"
import sys
import os
import arcgisscripting
import lib.pop.separate
if __name__=="__main__":
#create geoprocessor object
gp = arcgisscripting.create()
#store parameters
inFolder=sys.argv[1]
fieldName=sys.argv[3]
outFolder=sys.argv[4]
if sys.argv[5]=="true":
stemname=True
else:
stemname=False
namingSchemeValues=["Value","Order"]
namingScheme=namingSchemeValues.index(sys.argv[6])
for name in os.listdir(inFolder):
inName=inFolder+"\\"+name
gp.AddMessage("Spliting "+inName)
if stemname:
stem=name.replace(".","_")+".dbf"
else:
stem=""
lib.pop.separate.separateFile(inName,fieldName,outFolder,stem,namingScheme)