From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id 9EfNMDpmBGSPNAEAbAwnHQ (envelope-from ) for ; Sun, 05 Mar 2023 10:51:54 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id 05aAMDpmBGT2vAAAauVa8A (envelope-from ) for ; Sun, 05 Mar 2023 10:51:54 +0100 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 3F0F9145FB for ; Sun, 5 Mar 2023 10:51:54 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pYl18-0000WU-1T; Sun, 05 Mar 2023 04:50:58 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pYl15-0000W1-Us for emacs-orgmode@gnu.org; Sun, 05 Mar 2023 04:50:55 -0500 Received: from mail-ed1-x530.google.com ([2a00:1450:4864:20::530]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pYl14-00050U-2v for emacs-orgmode@gnu.org; Sun, 05 Mar 2023 04:50:55 -0500 Received: by mail-ed1-x530.google.com with SMTP id da10so27040589edb.3 for ; Sun, 05 Mar 2023 01:50:53 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:subject:cc:to:from:from:to :cc:subject:date:message-id:reply-to; bh=MtR0v51DdQqi7RmCKKGbUIB5mklDrLybgd2kUO/3If8=; b=mHZfVilH7QhphnsPT3WPEjHKQhGcL9uYlE+9sbm3x3foYPoMW0CcGID4zSZdZEgulR 3URu5zeiuh1bajfM0CrHNLz/ZHPcf1KmpSMmGz4hJx14nIFR2rlLGEf5gPNmyRn5KPhI +wDsRll7Z4+rndfLRIRbHN8/L59R3obP0xC+up5jLZqD49rZCFomym8AZzS+viQ+9dqN 7dnRLBywLx67lL4Y+s5rV++Hl7Ko10e7SPqysEVvGexYvcaHBjTXhZsO/IZFDHyVNWNq Xkq1/39vWpk/OAf5OVMdx2tuFJPa1Yja7/9ioC9WDqcLUgCVVa3yIT/LzPtOe4+IMOR2 cwHA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:subject:cc:to:from :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=MtR0v51DdQqi7RmCKKGbUIB5mklDrLybgd2kUO/3If8=; b=D2EpVkZJwLpbJe52iZLfIqOpvsdgi2cXOmvCrbc2S0yiV2PuO26HiCil8Yl+Q8Q2Sc 7qbv1e9IgpZqUgfjDEo7u4N4oK7JDlVMBktdbk5289sJR7RX709ZWEapsuS877G6Sx9H heYBH+ugvFxYR7S+q0qu/EhXeXX5Iff7IL3+mobfq1m2CzAJJpgwZomDMg4Z+xD3UlkV U7rE3BRDEe+BxNlQBz5se8wsmfZu+weaf3IxGFDc0phdIym9rqUcxSDrxsgCSwquUMM+ bo4TUkKLq+fpxN/V3wRgOPpT3p7xC7FCoBcPBJwFw8nk5fWpLo7/oJXngOLgDJxSyEUa WZmA== X-Gm-Message-State: AO0yUKXsIGzkTj0Dbjil2TTSb9xaoKjxM7rZL6Bd4qKyTCY2jJFmqgvV cn/XRe2Xk4HpfbgjgpyudJ/nCjq6qU7cAIMT X-Google-Smtp-Source: AK7set/od9Eo7XmJlDivg0uig29B11qxfxIv/trYR4l1/n8D3bwbSE9WBX2813sg/9Ta8IJe1wIm/g== X-Received: by 2002:a17:907:8e9a:b0:8f1:da18:c6ca with SMTP id tx26-20020a1709078e9a00b008f1da18c6camr8902342ejc.3.1678009851927; Sun, 05 Mar 2023 01:50:51 -0800 (PST) Received: from flexignu ([2a02:908:1d5:3c20:5f94:930e:439a:d5ef]) by smtp.gmail.com with ESMTPSA id my28-20020a1709065a5c00b008c9b44b7851sm3020649ejc.182.2023.03.05.01.50.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Mar 2023 01:50:51 -0800 (PST) From: Jeremie Juste To: emacs-orgmode@gnu.org Cc: tyler@plantarum.ca Subject: [FR] ob-awk.el specifying a delimeter argument in for output Date: Sun, 05 Mar 2023 10:50:50 +0100 Message-ID: <87ttyzcyrp.fsf@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=2a00:1450:4864:20::530; envelope-from=jeremiejuste@gmail.com; helo=mail-ed1-x530.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678009914; 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:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=MtR0v51DdQqi7RmCKKGbUIB5mklDrLybgd2kUO/3If8=; b=r7eHRT+AQ7TzH3D/xmma+ZmVFNo+XRnNYIRnkOHvFIoS2nVGe4SJzM/k78fOdQqNDOvLVV 410rnwexNT5yAJdpPExuzbYnNI/7ikVEzJtyQYSiz1rIMKB7cFAD6YhYEaG5iVGj+aVAoe YS97/pB2kneqVBW2FfocFS159rexqx4XxiYoi8OreYF3qMJ6PLW76Orwqdus3AzXRkBrSa +6zV1xbUpWxpDJNql9oMlix2aW5fjK8L/nQo1+JRM1aZ5k7TOI0NP4cyrI9K3ponZW78xV 1buMWfvkt1JjV/5w3O3fYpPtrL0P92DTyEfKDyQtWXe1Z0zbmGX2gAUr2l2hWw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mHZfVilH; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678009914; a=rsa-sha256; cv=none; b=GTo3eKIkQaH6C+Z6hcdXuqW+G78jUKcGYcRhpFY2k9GwxPlbCniRFoEwmdEp9IGYG/b0IC T9HA/K4pdNTzAP32Pqry/E036qI4sthtF6RekC8116LQ2Ly4SD6yeXt2jGZ0DR1rJb4I5J DxjeTyRsd2PUa835fo31SzsiQ0l0N4icVEH330dSiyvpkK7W0gfV5XYMZYIUV9h6cn+KKh E0ygAW+X69+N0CNHQCkR6/h19bxYpr9iL9v/U32Nd5QCWubkNvNcTQttVHkEt2LhcXfax3 ePSm7JQVSrOEnDRk8FYnBbi8tQIGLdQwyxLwYLPwQWOdTP5SGGZ4pbleae3/ng== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -4.93 X-Spam-Score: -4.93 X-Migadu-Queue-Id: 3F0F9145FB Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=mHZfVilH; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org"; dmarc=pass (policy=none) header.from=gmail.com X-TUID: YdVhEHBAyeUB Hello, ob-awk has proven very valuable to me lately so many thanks for maintaining it. First of all let me specify that I'm a beginner user of awk and I don't know if I'm using ob-awk as it is intended, so I'll be glad for any suggestions. Let me explain further: * Default behavior If I have a csv file with comma separated values, I get the output as an org table. ;; test.csv 123,0,123 #+begin_src awk :in-file test.csv :cmd-line -F "," {print $0} #+end_src #+RESULTS: | 123 | 0 | 123 | * Request However If I have a csv file with say semi column delimited values (;) I don't get the org table as output #+begin_src awk :in-file test1.csv :cmd-line -F ";" {print $0} #+end_src #+RESULTS: : 123;0;123 In my opinion, this could be fixed if we could read the :cmd-line parameter -F and use the delimeter argument ; as a parameter to the following function modified lisp/ob-awk.el @@ -93,7 +93,7 @@ This function is called by `org-babel-execute-src-block'." results (let ((tmp (org-babel-temp-file "awk-results-"))) (with-temp-file tmp (insert results)) - (org-babel-import-elisp-from-file tmp))))) + (org-babel-import-elisp-from-file tmp ";"))))) Would this be the right way to do think about this issue? Best regards, Jeremie PS Note that we have a samilar issue in ob-shell where the delimiter is by default a comma. #+begin_src shell echo '192;168;1;200' | awk -F ";" '{print $0}' #+end_src #+RESULTS: : 192;168;1;200 #+begin_src shell echo '192,168,1,200' | awk -F "," '{print $0}' #+end_src #+RESULTS: | 192 | 168 | 1 | 200 |