From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id YMH8JzuYBWRDCgAASxT56A (envelope-from ) for ; Mon, 06 Mar 2023 08:37:31 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id gEDgJzuYBWRdSgAAauVa8A (envelope-from ) for ; Mon, 06 Mar 2023 08:37:31 +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 5D31824878 for ; Mon, 6 Mar 2023 08:37:31 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TW8PkNj8; dmarc=pass (policy=none) header.from=gmail.com; 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" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1678088251; 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=hMmn95RL7ua+qrLf1b8Ntp9pGNyHqmD8GactV7cb8B4=; b=EXdChM8tTkrug64s65FMPBlpJxnqoC9KJmTf3oG9XFDi0QV1ZgbRo67JlXjFYtuNAxUn98 BAjkaMQ76lkAJFYl5gduOofjimU0c5K4PzemjSE3hH12VnF8QYNLkfOHJ3tAOqpWrNrStG q5vOMyJIE9s6pDeR2Pleyc7KfU5iIUqSnwmZinByQndxHMiwm7BimpVLXeS8ekoSeRvFmU 65/RkdXKsiY2x1Onvu2cimavzba/nqrBum7EomWmxJdji8KL5BoEPPNPRL1IH2nkBgmxyk EJVoGnxHSG2KMHBRkwy/UlvAAoFyJKfNEgNHHaTalcOh2ACoTH8KvdZ7q0esUw== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=TW8PkNj8; dmarc=pass (policy=none) header.from=gmail.com; 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" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678088251; a=rsa-sha256; cv=none; b=GNXnFm8+5EtwMp19j248mnZqYTNyDmEGU9fsn1gHlyuVw1aNGqSgH0qxq6UMgNTTx3EzDk X29wiArdn8wyf3Is/Eh+71zTz7dsdemsFxw7Mgc+si1xqvoSsup6TtY5CvFd3alXmac+hU K1I63eWxx7vqkxC2myW0h5CevVDclnhCCt+qMm/5S/Zm6lptc5xvOnOw9cMxu9R2qWOK4v VZGAs3mJ9J4qHvBPM5f6KE0lQRg3k7q5Sn/rwXacvAqt9ffNtjcIUAKi7BWkIk+G7V7Tdv ZYI2GjFxJHJxAiOPr54Jmfb9oyF2/8KsU0MGAHGETU1PbOyRRCZ8XSphaeeBKg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZ5Oj-0000hV-W8; Mon, 06 Mar 2023 02:36:42 -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 1pZ5OZ-0000eV-4y for emacs-orgmode@gnu.org; Mon, 06 Mar 2023 02:36:33 -0500 Received: from mail-ed1-x535.google.com ([2a00:1450:4864:20::535]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZ5OQ-0001cx-V7 for emacs-orgmode@gnu.org; Mon, 06 Mar 2023 02:36:26 -0500 Received: by mail-ed1-x535.google.com with SMTP id g3so34676399eda.1 for ; Sun, 05 Mar 2023 23:36:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=hMmn95RL7ua+qrLf1b8Ntp9pGNyHqmD8GactV7cb8B4=; b=TW8PkNj87shxtv2vfZmzePSfRcT9ANif7C3/TxrY4V8Pss4RwYG1gPNPZl1W7xRuIu ZO5egU6IqtkF2nsxSSgvuJdTG+Hz6MBAKknj0dKYoMm1y0OBwKVorTjzl955E8/qC4fz oG4ZKDuqQzZMNohVnA6zDFiKT8jrMehmeVjhiH+jeIYt2dgZ2YdDd5DYy3gOZo4EbEWe 64B8x5yS7H1IL9ftKY9pnFOzblU8+sWhZBLwZ3CqZB5Dg+Lbb1wLYEeOhAz1jR0lfEbZ RjDEcgHG/mL9xN5Spyew3KwsBNSyxGt0GknG3Udb+jqBvbPd/2ixOA+ednEjMfgydFsM GIhw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=hMmn95RL7ua+qrLf1b8Ntp9pGNyHqmD8GactV7cb8B4=; b=75iqPgfwojsyszhOWyHBDJhlFcYkp+By/zznCsrvdTEk5Rg594KQ/xXlXJcZkAHOIm 9ervoqnq0daN1z6AWHkShkTD24DQfrfSVpadfcgvQfYb1kPgm79UgzOOejYOeuzkAA2z RZMv1mnUYNVhrV4IvwxQCR4AQtmfazd01+Gmh2ndoy2IjZAq1imztutVTWmDEMkHovve EKBe46Z8aMK8pn0Hl0F1tbTiLKWPm5PLaDcwI35SzFqG0xirScSp7nSnqxIeqYUnC0Sk Iri0cnPWaXux5LiA1iNhRO9mLTHYucw0hxGUbYJktZjkMH4yPc+6q1MhL2Z71i7JTjLZ uNpA== X-Gm-Message-State: AO0yUKUaOsEgt1miVjbe1qtAQEvFX9IRxqak8qQS/OKAqzCbOtQgX1Sd 3kaWsNgGEJ/pUvtnFLFAKp8= X-Google-Smtp-Source: AK7set8lbZEoaRzKi6IYU9JtBYfCIZu2tkFVcxk/JM388aNUf2Jy9tpiWHe0nlVWUAY5NJ5KzaLgyw== X-Received: by 2002:aa7:ccd2:0:b0:4af:64b8:262e with SMTP id y18-20020aa7ccd2000000b004af64b8262emr9600244edt.6.1678088176605; Sun, 05 Mar 2023 23:36:16 -0800 (PST) Received: from flexignu ([2a02:908:1d5:3c20:5f94:930e:439a:d5ef]) by smtp.gmail.com with ESMTPSA id t30-20020a50ab5e000000b004ad601533a3sm4701178edc.55.2023.03.05.23.36.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Mar 2023 23:36:15 -0800 (PST) From: Jeremie Juste To: Ihor Radchenko Cc: emacs-orgmode@gnu.org, tyler@plantarum.ca Subject: Re: [FR] ob-awk.el specifying a delimeter argument in for output References: <87ttyzcyrp.fsf@gmail.com> <87bkl7z84p.fsf@localhost> Date: Mon, 06 Mar 2023 08:36:14 +0100 In-Reply-To: <87bkl7z84p.fsf@localhost> (Ihor Radchenko's message of "Sun, 05 Mar 2023 12:37:42 +0000") Message-ID: <877cvus55d.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::535; envelope-from=jeremiejuste@gmail.com; helo=mail-ed1-x535.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: X-Migadu-Scanner: scn0.migadu.com X-Migadu-Queue-Id: 5D31824878 X-Spam-Score: -11.74 X-Migadu-Spam-Score: -11.74 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 X-TUID: eam9I/qtRgd8 Hello Ihor, > Org knows nothing about your output, by default. > You could as well do something like {print $1+-+$2+-+$3} > What should Org do in such case? > > Currently, Org tries to guess the type of arbitrary output. If the > output looks like a table, with fields separated by tabs, commas, or > spaces, it converts the output to table. Otherwise, it is treated as > string. Many thanks for the insights. Ok, I guess this it likely to take some time, but it would be a great feature in my option. > > I guess we might add an option to tell Org which separator to use when > parsing output when :results table header argument is provided (see 16.6 > Results of Evaluation section of Org manual). However, you can achieve > the same now, using :post header argument, replacing the separators with > something Org can understand. Thanks for the suggestion. I tried using post replacing semi columns by commas but was surprised by the output. # file test.csv # 123;0;123 #+NAME: specific-delim #+BEGIN_SRC emacs-lisp :var tbl="" (replace-regexp-in-string ";" "," tbl) #+end_src #+RESULTS: specific-delim #+begin_src awk :in-file test.csv :cmd-line -F ";" :post specific-delim(*this*) {print $0} #+end_src #+RESULTS: : 123,0,123 After a short investigation, I notice that the function org-babel-import-elisp-from-file, is the function making the call wheter the result should be a table or not i.e before the :post argument. Have I understood correctly? If it is the case, then I would have to not just replace the delimeter but convert the entire results to an org-table. Best regards, Jeremie