emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [babel] Sh problem when echo'ing input data with ' inside
@ 2011-01-17 12:42 Sébastien Vauban
  2011-01-17 16:24 ` Eric Schulte
  2011-01-17 20:00 ` Achim Gratz
  0 siblings, 2 replies; 17+ messages in thread
From: Sébastien Vauban @ 2011-01-17 12:42 UTC (permalink / raw)
  To: emacs-orgmode-mXXj517/zsQ

Hi,

I tried to work on a CSV2Ledger, accepting the particular (European) CSV
format of my bank:

* Data

#+results: excel-from-bank
#+begin_example
Numéro du compte :;979-9500975-24;Compte Maxi
Date valeur;Référence de l'opération;Description;Montant de l'opération;Devise;Date d'opération;Compte de contrepartie;Nom de la contrepartie :;Communication 1 :;Communication 2 :
04-06-2009;A9F04NT01WK300TG;Virem. internet;420,00;EUR;04-06-2009;799-5900947-23;PAYEE ONE; ; 
24-02-2009;A9B24NT012K4018Z;Virem. internet;-54,93;EUR;24-02-2009;799-9974005-30;ME;Eigen rekening; 
18-05-2008;A8E19NT000S604QI;Virem. internet;-1.000,00;EUR;19-05-2008;799-8068445-18;PAYEE TWO; ; 
#+end_example

* "Europeanize" the CSV file

Here, we have to make several manipulations on the input file, such as:
- remove dots from amounts
- replace commas from amounts by dots
- replace semi-commas by commas
- etc.

My goal is to make that as a suite of bash commands (=echo | cmd 1 | cmd 2=),
tangled in a script file.

However, I can't do any work on the input file, the very basic echo command
already giving an error:

#+begin_src sh :var data=excel-from-bank :results output
echo "$data"
#+end_src

#+results:
Code block produced no output.

#+begin_src stderr
sh: line 3: unexpected EOF while looking for matching `''
sh: line 10: syntax error: unexpected end of file
#+end_src

In this sample, this is due to the apostrophe in the header line ("Montant de
l'opération").

Any idea on how to:
- circumvent such problem?
- or, eventually, do this better?

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2011-01-20 22:12 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-17 12:42 [babel] Sh problem when echo'ing input data with ' inside Sébastien Vauban
2011-01-17 16:24 ` Eric Schulte
2011-01-17 19:29   ` Sébastien Vauban
2011-01-17 19:54     ` Eric Schulte
2011-01-17 22:49       ` Sébastien Vauban
2011-01-17 20:00 ` Achim Gratz
2011-01-17 20:29   ` Eric Schulte
2011-01-17 21:36   ` Achim Gratz
2011-01-17 22:39     ` Sébastien Vauban
2011-01-17 22:51       ` Achim Gratz
2011-01-18  7:02         ` Sébastien Vauban
2011-01-18  9:22       ` Sébastien Vauban
2011-01-18 16:24         ` Eric Schulte
2011-01-18 17:31           ` Sébastien Vauban
2011-01-18 18:23         ` Achim Gratz
2011-01-20 19:17         ` Achim Gratz
2011-01-20 22:12           ` Sébastien Vauban

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).