From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Eric Schulte" Subject: Re: [babel] Sh problem when echo'ing input data with ' inside Date: Mon, 17 Jan 2011 09:24:28 -0700 Message-ID: <87tyh7jy6b.fsf@gmail.com> References: <80k4i3vgzo.fsf@missioncriticalit.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=49113 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Persk-00072T-Vp for emacs-orgmode@gnu.org; Mon, 17 Jan 2011 11:24:40 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Persj-0008EI-DB for emacs-orgmode@gnu.org; Mon, 17 Jan 2011 11:24:38 -0500 Received: from mail-gy0-f169.google.com ([209.85.160.169]:38565) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Persj-0008E0-6e for emacs-orgmode@gnu.org; Mon, 17 Jan 2011 11:24:37 -0500 Received: by gyd10 with SMTP id 10so2305094gyd.0 for ; Mon, 17 Jan 2011 08:24:36 -0800 (PST) In-Reply-To: <80k4i3vgzo.fsf@missioncriticalit.com> (=?utf-8?Q?=22S=C3=A9b?= =?utf-8?Q?astien?= Vauban"'s message of "Mon, 17 Jan 2011 13:42:35 +0100") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: =?utf-8?Q?S=C3=A9bastien?= Vauban Cc: emacs-orgmode@gnu.org Hi Seb, I can't reproduce this problem, on my system, I get the following correct behavior #+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;Dev= ise;Date d'op.ration;Compte de contrepartie;Nom de la contrepartie :;Commun= ication 1 :;Communication 2 : 04-06-2009;A9F04NT01WK300TG;Virem. internet;420,00;EUR;04-06-2009;799-59009= 47-23;PAYEE ONE; ;=20 24-02-2009;A9B24NT012K4018Z;Virem. internet;-54,93;EUR;24-02-2009;799-99740= 05-30;ME;Eigen rekening;=20 18-05-2008;A8E19NT000S604QI;Virem. internet;-1.000,00;EUR;19-05-2008;799-80= 68445-18;PAYEE TWO; ;=20 #+end_example #+begin_src sh :var data=3Dexcel-from-bank :results output echo "$data" #+end_src #+results: : Num.ro du compte :;979-9500975-24;Compte Maxi : Date valeur;R.f.rence de l'op.ration;Description;Montant de l'op.ration;D= evise;Date d'op.ration;Compte de contrepartie;Nom de la contrepartie :;Comm= unication 1 :;Communication 2 : : 04-06-2009;A9F04NT01WK300TG;Virem. internet;420,00;EUR;04-06-2009;799-590= 0947-23;PAYEE ONE; ;=20 : 24-02-2009;A9B24NT012K4018Z;Virem. internet;-54,93;EUR;24-02-2009;799-997= 4005-30;ME;Eigen rekening;=20 : 18-05-2008;A8E19NT000S604QI;Virem. internet;-1.000,00;EUR;19-05-2008;799-= 8068445-18;PAYEE TWO; ; and the sh code block expands to the following (with C-c C-v v) which is not affected by commas... #+begin_src sh data=3D$(cat < writes: > 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;D= evise;Date d'op.ration;Compte de contrepartie;Nom de la contrepartie :;Comm= unication 1 :;Communication 2 : > 04-06-2009;A9F04NT01WK300TG;Virem. internet;420,00;EUR;04-06-2009;799-590= 0947-23;PAYEE ONE; ;=20 > 24-02-2009;A9B24NT012K4018Z;Virem. internet;-54,93;EUR;24-02-2009;799-997= 4005-30;ME;Eigen rekening;=20 > 18-05-2008;A8E19NT000S604QI;Virem. internet;-1.000,00;EUR;19-05-2008;799-= 8068445-18;PAYEE TWO; ;=20 > #+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 (=3Decho | cmd 1 | cm= d 2=3D), > tangled in a script file. > > However, I can't do any work on the input file, the very basic echo comma= nd > already giving an error: > > #+begin_src sh :var data=3Dexcel-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 ("Montan= t de > l'op=C3=A9ration"). > > Any idea on how to: > - circumvent such problem? > - or, eventually, do this better? > > Best regards, > Seb