From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: [babel] Sh problem when echo'ing input data with ' inside Date: Mon, 17 Jan 2011 20:29:57 +0100 Message-ID: <80ei8b5nwq.fsf@missioncriticalit.com> References: <80k4i3vgzo.fsf@missioncriticalit.com> <87tyh7jy6b.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Eric, "Eric Schulte" wrote: >> I tried to work on a CSV2Ledger, accepting the particular (European) CSV >> format of my bank: >> >> * "Europeanize" the CSV file >> >> Here, we have to make several manipulations on the input file [...]. My >> goal is to make that as a suite of bash commands (=3Decho | cmd 1 | cmd = 2=3D), >> tangled in a script file. >> >> However, I can't do any work on the input file, the very basic echo comm= and >> already giving an error: >> >> #+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 ("Monta= nt de >> l'op=C3=A9ration"). > > 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;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 > > #+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= ;Devise;Date d'op.ration;Compte de contrepartie;Nom de la contrepartie :;Co= mmunication 1 :;Communication 2 : > : 04-06-2009;A9F04NT01WK300TG;Virem. internet;420,00;EUR;04-06-2009;799-5= 900947-23;PAYEE ONE; ;=20 > : 24-02-2009;A9B24NT012K4018Z;Virem. internet;-54,93;EUR;24-02-2009;799-9= 974005-30;ME;Eigen rekening;=20 > : 18-05-2008;A8E19NT000S604QI;Virem. internet;-1.000,00;EUR;19-05-2008;79= 9-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... I've no trouble with commas, except that it's not an American formatting for amounts. Though, I does well have problems, as showed, with the apostrophe.= .. Previewing does work for me as well: > #+begin_src sh > data=3D$(cat < 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 :;Co= mmunication 1 :;Communication 2 : > 04-06-2009;A9F04NT01WK300TG;Virem. internet;420,00;EUR;04-06-2009;799-5= 900947-23;PAYEE ONE; ;=20 > 24-02-2009;A9B24NT012K4018Z;Virem. internet;-54,93;EUR;24-02-2009;799-9= 974005-30;ME;Eigen rekening;=20 > 18-05-2008;A8E19NT000S604QI;Virem. internet;-1.000,00;EUR;19-05-2008;79= 9-8068445-18;PAYEE TWO; ; > BABEL_STRING > ) > echo "$data" > #+end_src Evaluation does not. > Are you on a windows machine? I'm not sure what else could be different > about the shell environment on our machines. Yes, it is on Windows=C2=A0;-) Though, with Cygwin bash support... which s= hould behave as on any Linux... > note: some of the characters in your email weren't printable when I > tried to send this with gnus, so they've been replaced with "."s These are French accentuated letters. >> Any idea on how to: >> - circumvent such problem? >> - or, eventually, do this better? No idea on any workaround, then? =C2=A0;-( Best regards, Seb --=20 S=C3=A9bastien 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