X-Git-Url: http://iramuteq.org/git?p=iramuteq;a=blobdiff_plain;f=tabsplitvar.py;h=73eca1ec442c5e28d05b42e11f6fa0c4829f8db3;hp=4deea43b94dca2638d49e2c873608d09a56736cd;hb=2560c66bef5e023dbce18c556363ec956bd15e47;hpb=db5a9978f585f997ec3c714e66b5b554b0783986 diff --git a/tabsplitvar.py b/tabsplitvar.py index 4deea43..73eca1e 100644 --- a/tabsplitvar.py +++ b/tabsplitvar.py @@ -13,6 +13,7 @@ from analysematrix import AnalyseMatrix from functions import exec_rcode, check_Rresult from dialog import FreqDialog from PrintRScript import PrintRScript +from tableau import Tableau class SplitMatrixFromVar(AnalyseMatrix): def doparametres(self, dlg=None) : @@ -25,6 +26,7 @@ class SplitMatrixFromVar(AnalyseMatrix): if val == wx.ID_OK : self.parametres['colsel'] = dial.m_listBox1.GetSelections() self.parametres['header'] = dial.header + self.parametres['tohistory'] = False else : self.parametres = None dial.Destroy() @@ -32,7 +34,10 @@ class SplitMatrixFromVar(AnalyseMatrix): def doanalyse(self): newtabs = self.tableau.splitfromvar(self.parametres['colsel'][0]) for mod in newtabs : - fout = self.tableau.pathout['%s.csv' % mod].replace(u'*','') - with open(fout, 'w') as f : - f.write('\n'.join(['\t'.join(line) for line in newtabs[mod]]).encode(self.parent.syscoding)) - print 'done!' \ No newline at end of file + tab = Tableau(self.ira, os.path.join(self.tableau.pathout['%s.csv' % mod]).replace(u'*','')) + if not os.path.exists(tab.pathout.dirout) : + os.mkdir(tab.pathout.dirout) + tab.linecontent = newtabs[mod] + tab.make_content_simple() + tab.parametres['matrix'] = tab.parametres['uuid'] + self.ira.tree.OnItemAppend(tab.parametres, select = False) \ No newline at end of file