x = spacegroup("all")
types = {"all":[1, 230]}

for (name in types) {
lat = types[name]

a = ""
lastname =""
for (var sg in x.spaceGroupInfo) {
  if (sg.itaFull == lastname || sg.itaFull.find("*") > 0 || sg.ita < lat[1] || sg.ita > lat[2]) {
    print "dup " + sg.itaFull
    continue
  }
  lastname = sg.itaFull
  var s = lastname.split(":")
  var post = (s.length == 1 ? "" : ":" + s[2]) 
  var pre = "\n\"" + s[1].format("%03s")+post + "\"\t\""
  var list = sg.operationsXYZ
  var n = sg.operationCount
  for (var i = 1; i <= n; i++){
    a +=  pre +  list[i] + "\""
  }
}

write var a @{"c:/temp/sg_"+name}
}

