From a39551e58332ab892391636bcfcbd48575ae4b9f Mon Sep 17 00:00:00 2001 From: bcolsen Date: Sat, 10 Jun 2017 15:23:12 -0600 Subject: [PATCH] Added Whitespace option in the import wizard --- spyder/widgets/variableexplorer/importwizard.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/spyder/widgets/variableexplorer/importwizard.py b/spyder/widgets/variableexplorer/importwizard.py index 387a44b251f..fa2e5d23f49 100644 --- a/spyder/widgets/variableexplorer/importwizard.py +++ b/spyder/widgets/variableexplorer/importwizard.py @@ -142,6 +142,9 @@ def __init__(self, parent, text): self.tab_btn = QRadioButton(_("Tab")) self.tab_btn.setChecked(False) col_btn_layout.addWidget(self.tab_btn) + self.ws_btn = QRadioButton(_("Whitespace")) + self.ws_btn.setChecked(False) + col_btn_layout.addWidget(self.ws_btn) other_btn_col = QRadioButton(_("other")) other_btn_col.setChecked(True) col_btn_layout.addWidget(other_btn_col) @@ -231,6 +234,8 @@ def get_col_sep(self): """Return the column separator""" if self.tab_btn.isChecked(): return u"\t" + elif self.ws_btn.isChecked(): + return None return to_text_string(self.line_edt.text()) def get_row_sep(self): @@ -462,7 +467,10 @@ def open_data(self, text, colsep=u"\t", rowsep=u"\n", if pd: self.pd_text = text self.pd_info = dict(sep=colsep, lineterminator=rowsep, - skiprows=skiprows,comment=comments) + skiprows=skiprows, comment=comments) + if colsep is None: + self.pd_info = dict(lineterminator=rowsep, skiprows=skiprows, + comment=comments, delim_whitespace=True) self._table_view.process_data(text, colsep, rowsep, transpose, skiprows, comments)