From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.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 0A1wAg66BWQY1AAASxT56A (envelope-from ) for ; Mon, 06 Mar 2023 11:01:50 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id SBCcAQ66BWSoKAAAG6o9tA (envelope-from ) for ; Mon, 06 Mar 2023 11:01:50 +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 86EEA286E4 for ; Mon, 6 Mar 2023 11:01:49 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pZ7eU-00042u-Iq; Mon, 06 Mar 2023 05:01:06 -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 1pZ7eQ-00042i-KP for emacs-orgmode@gnu.org; Mon, 06 Mar 2023 05:01:02 -0500 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pZ7eO-0007mH-D5 for emacs-orgmode@gnu.org; Mon, 06 Mar 2023 05:01:02 -0500 Received: by mail-lf1-x12d.google.com with SMTP id i9so11935261lfc.6 for ; Mon, 06 Mar 2023 02:00:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678096858; h=content-transfer-encoding:in-reply-to:mail-followup-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:sender:from:to:cc:subject:date:message-id:reply-to; bh=m94DBssR7UA7onlpKiTMBYVLmVCK09vJkoqREupqwUA=; b=JATcdNML1YNKoyy1YbwybHz6pwLKq/nory33qLNfc6jNL0FbG/2Fqtv90/Hd+tpWkx IaZCENgpYRj3PzSfZQaWQ3hMWOJP7dIkhTeszN+lRvShLIbGRTi45IoEbogRndhXtuEe I+bYb1pS2iDg42lML3HG6HX/xJ7eW8MaNymX2Swnd84DFSu9q7G4xMFFFdw4WXpnA0jN +sSY+8b5EpbhJT+ot7HflXCmpJ9DyUi9LoMoJNilx6BlLvV/rPkIp407jBwILk0ohAbI OrG/01ZGterM89GZnT28EicSrjC08BRRzWsm5+psVOUb9puDBTdvhijyskq5W5lIjco2 rJKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678096858; h=content-transfer-encoding:in-reply-to:mail-followup-to:from :references:to:content-language:subject:user-agent:mime-version:date :message-id:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=m94DBssR7UA7onlpKiTMBYVLmVCK09vJkoqREupqwUA=; b=i7NFmoe32iqcZ/KRgmUhpO5CyXq6Cb9kRzc+pVagHE+UcATYyDY2s3HlA5U5/6L7G3 pi1yyjCjuavcZCExFlfz2iQMkdwjNH91BFN1WxMRi2rOZJHqwC/hb9iiTqliWMUTNxOS C7BIQI/H1eaqkKYkeVXL/8f7UDwgtlue7h7d8+c9h3EQFl8BGfeQvFgGaLjQJLIjn85s 8qAP535eQ4xLi+QPw3inPRn0kOw5OtAa/8+XoHtbFIw8nzXuvfk9ylmEcZj6vB+I0Lpv RKkn8XXBvyIkmakcbcikuDv88cyAPPlba6ygh4SC/UM13NGsSFaCtJ2iHxuZxug8O9UG J1Pw== X-Gm-Message-State: AO0yUKX5OGdWEbh7zLdTNsotMnPzGwwvQ3Cdby2bb2IRaaIWnK6eiTiF UfO1BK9M8SVZERnoXJlm9lU= X-Google-Smtp-Source: AK7set/19BNZkN80CDANFptozmHu/k9hLpO95VhuRKzPm2mUzn3OuZVUCpAt9BRDIP24n74fY6eYNw== X-Received: by 2002:ac2:50cb:0:b0:4d8:542e:92b6 with SMTP id h11-20020ac250cb000000b004d8542e92b6mr2672928lfm.19.1678096857588; Mon, 06 Mar 2023 02:00:57 -0800 (PST) Received: from [192.168.0.101] (nat-0-0.nsk.sibset.net. [5.44.169.188]) by smtp.googlemail.com with ESMTPSA id p12-20020a19f00c000000b004d2199ea23dsm1571486lfc.0.2023.03.06.02.00.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Mar 2023 02:00:57 -0800 (PST) Message-ID: Date: Mon, 6 Mar 2023 17:00:54 +0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [FR] ob-awk.el specifying a delimeter argument in for output Content-Language: en-US To: Jeremie Juste , emacs-orgmode@gnu.org References: <87ttyzcyrp.fsf@gmail.com> From: Max Nikulin Mail-Followup-To: Jeremie Juste , emacs-orgmode@gnu.org In-Reply-To: <87ttyzcyrp.fsf@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Received-SPF: pass client-ip=2a00:1450:4864:20::12d; envelope-from=manikulin@gmail.com; helo=mail-lf1-x12d.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, NICE_REPLY_A=-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=1678096909; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=m94DBssR7UA7onlpKiTMBYVLmVCK09vJkoqREupqwUA=; b=sQX7/M2Pp2AmbTs7G8S+azlbqV34GXBOBU6HOTxB7+RgokGlQTlf83qrr/khqxU2vz4Lar 4kla+k/T+qhvfzSX2cei3hK0SOzK+dcpNoaDma2e8RMeGSjOhATY9WMzb6E7KQqIKmJkvn xNBYc+ZSecpsfAbBNk5VJptk8Z8A351UAXAwzppfxGoaz4eUyxzO+uekezP1vj2UP/qe+9 kTVC6CODFR3emj47UyHk/Xozp2hdFDasw7dqshB11AlRfZTPdiG+kH6RYaIWumvQqPI6M7 lKhgmOpSaqfMPfgVXxJXsTY6RuLB5/yI42m2EVi1BR3TGD0iGFYa9G7GEb128w== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=JATcdNML; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) ARC-Seal: i=1; s=key1; d=yhetil.org; t=1678096909; a=rsa-sha256; cv=none; b=kqaTaBGkyhNGKtxxBW4sDO+rGx+WJlhuaUUv5icxr1eKS54mtbrErCQGpger8B+fCn4YIC usd1NqEvz4Njgunl9H4zQ4FAjnf1jn1t+hAwhaAA8wGzlFDbAf+h0aUGmEiXw18gb0RWGs Vsr/3T2PGtQ0MOZ4MjOkCAXet2GOPiovMcfP/aAoXv/LXpeBhLObueMsLk5/P6XjbYPcA1 xR7LXE3TX5+IDrW60khrwdhRPLdStFHAn6bkAQfDvvhI1dD5D6RCNJ7kRqGSR6LkH1DB67 Mgdat1IeMnqVEH9vPcLx7NUgqwKqpvfx7MyR4ifF7L56PKCW3gcDXwPAOExKPw== X-Migadu-Scanner: scn1.migadu.com X-Migadu-Spam-Score: -1.91 X-Spam-Score: -1.91 X-Migadu-Queue-Id: 86EEA286E4 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=JATcdNML; 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=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none) X-TUID: QHn8Fkm6p7Nj On 05/03/2023 16:50, Jeremie Juste wrote: > #+begin_src awk :in-file test.csv :cmd-line -F "," > {print $0} > #+end_src Notice that awk has Output Field Separator that is space by default and may be set using -v OFS=; (or --assign) command line options. -F option sets input field separator FS variable. "print $0" just sends input record to output literally. If you try to modify some field then record is rebuilt taken into account OFS echo 1,2 | awk -F , '{ $1=$1+10; print; }' 11 2 See (info "(awk) Changing Fields)") https://www.gnu.org/software/gawk/manual/gawk.html#Changing-Fields I just have found this link on stackoverflow. It is enough to add even $1=$1 that should not really modify field values. So I expect less issues with a more realistic example. As to ";" as CSV values separator, it often appears with "," as decimal separator 1234,56 and dd.mm.yyyy date formats. Unfortunately handling of localized data formats is not a strong side of Emacs. E.g. fixed LC_NUMERIC=C forces "." as decimal separator, date parsing functions are rather limited.