Note: This was originally posted by an inactive account. Content was preserved by moving under an admin account.
Originally posted by: Bryt ParkHi,
The following code can output my results but it keeps overwriting previous output, so I am always only getting the last line.
How can I make it output all the results, append rather than overwrite? thanks!
def Process(self, filename):
success = False
outRec = self.outputs[0].newRecord()
with open(filename,'rU') as f:
reader = csv.reader(f))
for row in reader:
outRec["ImportedData"] = row
self.outputs[0].write(outRec)
success = True