From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id un2KFgF+mWCaFwAAgWs5BA (envelope-from ) for ; Mon, 10 May 2021 20:40:01 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id yLB/EQF+mWBFHgAAB5/wlQ (envelope-from ) for ; Mon, 10 May 2021 18:40:01 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 9867C8730 for ; Mon, 10 May 2021 20:40:00 +0200 (CEST) Received: from localhost ([::1]:57686 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgAow-0003jj-Jo for larch@yhetil.org; Mon, 10 May 2021 14:39:58 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:58764) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgAlx-0003OV-TW for emacs-orgmode@gnu.org; Mon, 10 May 2021 14:36:55 -0400 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]:54959) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgAlw-00047F-7p for emacs-orgmode@gnu.org; Mon, 10 May 2021 14:36:53 -0400 Received: by mail-pj1-x1035.google.com with SMTP id g24so10282217pji.4 for ; Mon, 10 May 2021 11:36:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=BRXjN/KMlqbdAaywuZSlEEiP/91zcok4t3yAAP4AJk4=; b=E1zaSKFvmbjjf4SAEAu18wz5yCwFMHxDTM8be+qIjCDNj+okolOAlfTXqjYW+Dhb+/ RBUf7OSVLBAnddD1yujR/w35IP8aYJmp2/ZUE95LW6BIQ2ehFwt5vkSlKDCJpm+s7Lov ah13pQHdtBmnOXlFUwsJw8h3MTiKix4lqplnOVwF4grrSi1THv4rJWNUZUrL1xvgnPEl HdMWwd2eaVJE/coXQomSbJ8suc6kG1rnaa4GkaHOOFg8ha/U4Yo71TA3SaKhIL677KBC e0VzYAhCg4LXoq82TyQYyFOql/KbE0jmG7huqtydiobFeyb+RTgOft3sOAMQJKkF/6eE g8BQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=BRXjN/KMlqbdAaywuZSlEEiP/91zcok4t3yAAP4AJk4=; b=aOptBfu5eQ3pXCqu3+HII6wzukY3I1z6wYfTl3L4kMM6A3lKNiyQpnDrU679LJeRIz ah1B5WxK2jNcTWN6+ZGavfKuAHdOIyH13UN3J4786EIOZpVNN9ea8C3D12GmNXnlbpI8 y7V5D28/nSjftIElMyyPZ6c7WJCnluV7BkSyygpsUvYZf2AmN1OXM7sHKFU6xfRUWQTM H/Q+4tzpw2ZI3HLPzrrOOUPRhF9blwo3rHQ1MKIXPcJ9C7Z3H5KR6C+1HYwBv5hYUXyk LvC6u/ftsFIFpqPWyFOXniEzoZ2jreY0z+nmKcD6oQPNotfQFm6Ic3EJA3xVSz+anGcj CCkA== X-Gm-Message-State: AOAM533SdUMQClFgzPSkIMHg74eBFZBRcDRxgXoiWkISnOc1NU8LXKms jpjDatf0f6zLs7X6Wz4a+R0= X-Google-Smtp-Source: ABdhPJyoE+5knBMP4d7ol1bnf3iSEjFm3E0LtDrWBfne/hgPeU+qSEnqnDcJJkwrfIhd06uy8t9MZA== X-Received: by 2002:a17:90a:c8:: with SMTP id v8mr581493pjd.18.1620671809043; Mon, 10 May 2021 11:36:49 -0700 (PDT) Received: from localhost ([45.251.50.206]) by smtp.gmail.com with ESMTPSA id v18sm12152220pff.90.2021.05.10.11.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 May 2021 11:36:48 -0700 (PDT) From: Utkarsh Singh To: Maxim Nikulin Subject: Re: bug#47885: [PATCH] org-table-import: Make it more smarter for interactive use References: <87czuq9958.fsf@gmail.com> <8735vmelfs.fsf@nicolasgoaziou.fr> <87k0oyfj4y.fsf@gmail.com> <87im4h9irn.fsf@nicolasgoaziou.fr> <87zgxpwqa7.fsf@gmail.com> <875z07jx6n.fsf@nicolasgoaziou.fr> <87tunqby9a.fsf@gmail.com> Date: Tue, 11 May 2021 00:06:55 +0530 In-Reply-To: (Maxim Nikulin's message of "Wed, 28 Apr 2021 23:38:47 +0700") Message-ID: <875yzq77w8.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2607:f8b0:4864:20::1035; envelope-from=utkarsh190601@gmail.com; helo=mail-pj1-x1035.google.com X-Spam_score_int: 1 X-Spam_score: 0.1 X-Spam_bar: / X-Spam_report: (0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_OTHER_BAD_TLD=1.997, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620672000; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=BRXjN/KMlqbdAaywuZSlEEiP/91zcok4t3yAAP4AJk4=; b=ljNcth1JfghJ76rTRGIixekvj6SqzO/a9WTBo3Hn/9SqO/D6e+M1V45k5ltDh6gyZmCxU7 /3gmwV5IK8sK1DNyDef9tUBbQAHvUNERDOG00IJOjyBqWXVkOax6g95EH+V/zYJL4zfqsj R+HKhtDtAqucvKOtHJmWR9gfhDxiGTnbmReKH4hecC3t3mKpzF3bR4IdmpzpPkBWZkBYyo NW59Hf7+4Bo7C5lmFyVUGDQ3NynQq24EDYAu0QijW6eZ47Jm9c9v7aG45wSAVF2na+D2cy Dk3Ip5pTApjI83sQFeGHNlfxKuP0fddETZrrGRUdngQXGle/75S8nCl6mClsAg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620672000; a=rsa-sha256; cv=none; b=b1YbR9QO0cBkIEgzrGv/YpwEjKat/CCy2mkc1J6XyPBI1ospt9zD0PMKjmxRiqm1rG8faW x7Q6SO8IDuZeItrCXL3ch2w3quyxgJ4psfmktDlC1L/LxDlYQg6kodMMWAktgIeOCjAmgG wIP56h8gupRvWbMpxgT/UYyUQvO/SxmJ4UExVMDkHekNGBhnOuN6N3VWCLw3hBpaYA8+AP zrAVz2Gx8sfncXRGeU+g4flzlrWuRxZ0F8bnbm8enFsMqSyzJ522ePWBqh5DEWACCF063t lZW1EZMwBSp9Ne+q82h7Kqab2hIvnW9Q9xS+G0/eA41PBVj5Ol+mGnL3TmNMuw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=E1zaSKFv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -3.15 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=E1zaSKFv; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 9867C8730 X-Spam-Score: -3.15 X-Migadu-Scanner: scn0.migadu.com X-TUID: r9ZR1zTFky1A Hi Maxim, Sorry for the late reply! On 2021-04-28, 23:38 +0700, Maxim Nikulin wrote: > On 28/04/2021 15:37, Utkarsh Singh wrote: >> +List of preferred separator (in order of preference): >> +comma, TAB, semicolon, colon or SPACE. > I will hardly be using this feature heavily, so I do not insist that > the following must be taken into account. Just some considerations... > > There are locales where comma is used as decimal separator 23,5 > (e.g. ru_RU.UTF-8). Office software and applications oriented to > office users often use semicolon as field separator. There are still > may be plenty of numbers with fractional part, so with commas. Likely > ";" should be tried at first for such locales. > > However the same user may have enough CSV files that are really "comma > separated", e.g. results of numerical simulation where localization is > intentionally ignored, data obtained from some equipment, etc. > > Some files (e.g. downloaded bank statements) may be in legacy 8-bit > encoding instead of UTF-8. > > As a result, sometimes the only convenient way is to try various > options with interactive preview. What do we mean by interactive preview? Does this mean that we should present a user with a list of possible delimiters using minibuffer? If you are suggesting this then rather trying 'various options' based on locals you can use =org-table-import= function directly as it accepts separator as it's argument. For ex (please review my usage of alist): #+begin_src elisp (defvar my-separator-alist '(("comma" . ",") ("tab" . "\t") ("semicolon" . ";") ("colon" . ":") ("space" . " "))) (defun my/table-import (file separator) (interactive (list (read-file-name "Import CSV file: " nil nil t) (cdr (assoc (completing-read "Separator: " my-separator-alist) my-separator-alist)))) (org-table-import file separator)) #+end_src -- Utkarsh Singh http://utkarshsingh.xyz