emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jeremie Juste <jeremiejuste@gmail.com>
To: Ihor Radchenko <yantar92@posteo.net>
Cc: emacs-orgmode@gnu.org,  tyler@plantarum.ca
Subject: Re: [FR] ob-awk.el specifying a delimeter argument in for output
Date: Mon, 06 Mar 2023 08:47:44 +0100	[thread overview]
Message-ID: <87zg8qqq1r.fsf@gmail.com> (raw)
In-Reply-To: <877cvus55d.fsf@gmail.com> (Jeremie Juste's message of "Mon, 06 Mar 2023 08:36:14 +0100")


Hello Ihor,

>> 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 again for the suggestion, after giving your solution more thoughts, I could
achieve the desired output. 

# file test.csv
# 123;0;123

#+NAME: specific-delim
#+BEGIN_SRC emacs-lisp :var tbl="" delim=";"
(format "|%s"  (replace-regexp-in-string delim  "|" tbl))
#+end_src

#+RESULTS: specific-delim
: |



#+begin_src awk :in-file test.csv :cmd-line -F ";" :post specific-delim(*this*,";") :results raw
 {print $0}
#+end_src

#+RESULTS:
| 123 | 0 | 123 |


Best regards,
Jeremie


  reply	other threads:[~2023-03-06  7:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-05  9:50 [FR] ob-awk.el specifying a delimeter argument in for output Jeremie Juste
2023-03-05 12:37 ` Ihor Radchenko
2023-03-06  7:36   ` Jeremie Juste
2023-03-06  7:47     ` Jeremie Juste [this message]
2023-03-06 10:00 ` Max Nikulin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zg8qqq1r.fsf@gmail.com \
    --to=jeremiejuste@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=tyler@plantarum.ca \
    --cc=yantar92@posteo.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).