def getFilename(schema): f = open(schema, "r") d = {} filenames = [] for line in f: if line.startswith("d"): path = line.split()[2] # Split out the unique table ID # First take the core section: "TRANSACTION":7,64 # Now split out the unique number - 7 j = line.split()[1] if "Schema" not in j: k = j.split(':')[1].split(',')[0] if k not in d: d[k] = 1 else: d[k] = d[k] + 1 for t in d.items(): filenames.append(path + "/" + DBNAME + "_" + str(t[0]) + ".d" + str(t[1])) return filenames