From 501d44fa046202d0d3ce06eadf506f6124cbd179 Mon Sep 17 00:00:00 2001 From: depristo Date: Wed, 29 Dec 2010 16:25:59 +0000 Subject: [PATCH] Minor bug fixee, replace double quotes with single quotes in strings so that R can read the resulting table git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@4910 348d0f76-0448-11de-a6fe-93d51630548a --- python/analyzeRunReports.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/python/analyzeRunReports.py b/python/analyzeRunReports.py index 91ac835e7..a779b7751 100755 --- a/python/analyzeRunReports.py +++ b/python/analyzeRunReports.py @@ -193,15 +193,21 @@ class RecordAsTable(StageHandler): val = parsed[field] if val == None: if OPTIONS.verbose: print >> sys.stderr, 'field', field, 'is missing in', parsed['id'] - elif val.find(" ") != -1: - val = "\"" + val + "\"" + else: + val = val.replace('"',"'") +# if val.find("\t") != -1: +# if OPTIONS.verbose: print >> sys.stderr, 'Warning -- val', val, 'contains tabs, droping field', field +# raise Error + #val = "value contained tabs, dropped" + if val.find(" ") != -1: + val = "\"" + val + "\"" return val try: print >> self.out, "\t".join([ oneField(field) for field in self.decoder.fields ]) except: + print 'Failed to convert to table ', parsed pass - #print 'Failed to convert to table ', parsed - + addHandler('table', RecordAsTable) class CountRecords(StageHandler):