From 36ee8a78ece08c3fd18ec2cd4904e464641e0b5d Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Tue, 7 Aug 2018 16:34:11 +0200 Subject: [IMP] base_import: attempt to automatically guess the separator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It would probably be even better to iterate the file content and get the non-quoted non-alphanumeric characters as separator candidates (instead of a hard-coded list) however Python does not seem to have a decoding iterator (taking bytes and yielding an iterator of codepoints or even grapheme clusters) — incidentally uniseg seems to require up-front decoding as well — so that's not really convenient as we may be dealing with large-ish files and not want to load it entirely in memory. An alternative would be to use TextIOWrapper and iterate the file by buffers of a few ks, and classify that based on either codepoints or grapheme clusters. --- addons/base_import/static/src/js/import_action.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/base_import/static/src/js') diff --git a/addons/base_import/static/src/js/import_action.js b/addons/base_import/static/src/js/import_action.js index 87a971d0dc5..6c28797161d 100644 --- a/addons/base_import/static/src/js/import_action.js +++ b/addons/base_import/static/src/js/import_action.js @@ -76,7 +76,7 @@ var DataImport = AbstractAction.extend(ControlPanelMixin, { template: 'ImportView', opts: [ {name: 'encoding', label: _lt("Encoding:"), value: ''}, - {name: 'separator', label: _lt("Separator:"), value: ','}, + {name: 'separator', label: _lt("Separator:"), value: ''}, {name: 'quoting', label: _lt("Text Delimiter:"), value: '"'} ], parse_opts: [ -- cgit v1.2.3