From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/97079 Path: news.gmane.org!.POSTED!not-for-mail From: DesdeChaves Newsgroups: gmane.comp.tex.context Subject: Re: scancsv module and lua Date: Mon, 16 Jan 2017 17:45:26 +0000 Message-ID: References: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2310393487921544159==" X-Trace: blaine.gmane.org 1484588758 12381 195.159.176.226 (16 Jan 2017 17:45:58 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Jan 2017 17:45:58 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 16 18:45:53 2017 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from zapf.boekplan.nl ([5.39.185.232] helo=zapf.ntg.nl) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cTBLq-0002aK-Ck for gctc-ntg-context-518@m.gmane.org; Mon, 16 Jan 2017 18:45:50 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 9FFC9124025D; Mon, 16 Jan 2017 18:45:40 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 7St8b7TE7x11; Mon, 16 Jan 2017 18:45:39 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id DC6EE1240262; Mon, 16 Jan 2017 18:45:39 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id B1333124025D for ; Mon, 16 Jan 2017 18:45:39 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at zapf.boekplan.nl Original-Received: from zapf.ntg.nl ([127.0.0.1]) by localhost (zapf.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id d6iVJFQk4dQL for ; Mon, 16 Jan 2017 18:45:37 +0100 (CET) Original-Received: from mail-wm0-f45.google.com (mail-wm0-f45.google.com [74.125.82.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by zapf.ntg.nl (Postfix) with ESMTPS id 929C4124025C for ; Mon, 16 Jan 2017 18:45:27 +0100 (CET) Original-Received: by mail-wm0-f45.google.com with SMTP id d140so14577346wmd.0 for ; Mon, 16 Jan 2017 09:45:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to; bh=yl4UzAFbsFnSmjn1NvJOt0dEjrxOaeJ6Q14mKYIq1YI=; b=oWGh68s5wyg9hXSllzqAZNedeBpkTP1PFGCRjAerSRGfzvYyxgVErNFZHl1DVGp/wK 7SGCDcm8xC8fDTOfGkGxSnIZLEUZBs5KLRdhpEjiKE6hPF5MIrOBUbfxKJkizXMwQZrj CwK0CNa55a8E3cnLHL8tWxt6SPgUzquR5fb48sY2xNwW9FF8kAsZa2E6tYyRMEowuuNZ dGRNeycgzN2STreaL6fY+HEat2bHj90bOE7pVvWeQyYVYIRWuTxn6TmbsikTqmTnjxX0 kn+w24ObDayM6xTUvqMeQWpA6RwyD1krZtpt02XiaCyLscF1gk7w86ta3gEv1YVPWbCl trCA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=yl4UzAFbsFnSmjn1NvJOt0dEjrxOaeJ6Q14mKYIq1YI=; b=h0DPl7YH2/jGO6vHXPOcWfjwjbhu5Lzn5E/vHIeMugeQTx8uyQmxmsHv6jbWRGhln5 b+9ChrTD2Rt46NWX891Xrcvle6WkManmdE2k6XV1m1DKXsp27NDufAx96uaKQnH1XLJt 4knsX8QvKnFN5VGLbGFu7RVZCB+dzNydSKX3HAKEXgRE6seHDGQbPIzKMQMHi9gY2WLB 9/mq/ykMOY/4q/C3Kq+Gwb+KpkvWDWF4Q/cDK6Ry4vuubAeCOyL7kKUkAw9k/lyH71HK 5SIqnLBK5hUpSadiEFFDQhNyECJIVYpZLz+3eeZHzoY5WSo3GULSiwQ52jlRk8KEbKY2 0SOA== X-Gm-Message-State: AIkVDXKrKAS9Cnz17kPu6H83aqrGh2EiRX1FQpsd3zmf+N0u+u3KxTEEdbSoqVXxk781oIy0/DawaZwfOqZfVQ== X-Received: by 10.223.150.58 with SMTP id b55mr23767247wra.192.1484588727013; Mon, 16 Jan 2017 09:45:27 -0800 (PST) Original-Received: by 10.28.95.2 with HTTP; Mon, 16 Jan 2017 09:45:26 -0800 (PST) In-Reply-To: X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.16 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: ntg-context-bounces@ntg.nl Original-Sender: "ntg-context" Xref: news.gmane.org gmane.comp.tex.context:97079 Archived-At: --===============2310393487921544159== Content-Type: multipart/alternative; boundary=001a1146a13cb614f4054639bf76 --001a1146a13cb614f4054639bf76 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Fixed. Sorry for the noise. 2017-01-16 17:35 GMT+00:00 DesdeChaves : > Dear sirs, > > In my project I need to format some data from a csv file. The csv file is > scanned using the scancsv module and part of this information is formatte= d > inside luacode environment, but the text.print("") and the context("") > functions don=C2=B4t be able to send the formatted data to the output. T= he > result is a empty pdf. > > The example attached is from a old question. > > Thanks a lot for your time > > Jorge M. > > --- example -- > > \usemodule[scancsv] > > \def\ddmmyyyy#1#2#3{% #1 - date, #2 - old separator, #3 - new separator > \startlua > local parsedate=3Dthirddata.scancsv.ParseCSVLine('#1','#2'); > local day=3Dtonumber(parsedate[1]); > local month=3Dtonumber(parsedate[2]); > local year=3Dtonumber(parsedate[3]); > -- tex.print(day..'#3'..month..'#3'..year); > text.print("Hello"); > \stoplua > } > > \unexpanded\def\lineaction{ > \Name\ arrived on \ddmmyyyy{\Date}{/}{.\\,} \\ > } > > > % Name;Date > % ME;11/10/14 > % You;05/02/14 > % He;15/02/2014 > % She;03/03/12 > % It;03/03/14 > > \setheader > \setsep{;} > \setfiletoscan{mail.csv} > > \starttext > \filelineaction > \stoptext > --=20 Atentamente DesdeChaves --001a1146a13cb614f4054639bf76 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Fixed. Sorry for the noise.

2017-01-16 17:35 GMT+00:00 DesdeChaves <desdechaves@gmail.com>:
=
Dear sirs,

In my project I n= eed to format some data from a csv file. The csv file is scanned using the = scancsv module and part of this information is formatted inside luacode env= ironment, but the text.print("") and the =C2=A0context("&quo= t;) =C2=A0functions don=C2=B4t be able to send the formatted data to the ou= tput. The result is a empty pdf.

The example attac= hed is from a old question.

Thanks a lot for your = time

Jorge M.

--- example= --

\usemodule[scancsv]

\= def\ddmmyyyy#1#2#3{% #1 - date, #2 - old separator, #3 - new separator
\startlua
=C2=A0 =C2=A0 =C2=A0local parsedate=3Dthirddata.s= cancsv.ParseCSVLine('#1','#2');
=C2=A0 =C2= =A0 =C2=A0local day=3Dtonumber(parsedate[1]);
=C2=A0 =C2=A0 =C2= =A0local month=3Dtonumber(parsedate[2]);
=C2=A0 =C2=A0 =C2=A0loca= l year=3Dtonumber(parsedate[3]);
-- =C2=A0 =C2=A0 tex.print(day..= '#3'..month..'#3'..year);
=C2=A0 =C2=A0 =C2= =A0text.print("Hello");
\stoplua
}
=
\unexpanded\def\lineaction{
=C2=A0 =C2=A0 =C2=A0\N= ame\ arrived on \ddmmyyyy{\Date}{/}{.\\,} \\
}


% =C2=A0 =C2=A0 Name;Date
% =C2=A0 =C2=A0 M= E;11/10/14
% =C2=A0 =C2=A0 You;05/02/14
% =C2=A0 =C2=A0= He;15/02/2014
% =C2=A0 =C2=A0 She;03/03/12
% =C2=A0 = =C2=A0 It;03/03/14

\setheader
=C2=A0 \se= tsep{;}
=C2=A0 \setfiletoscan{mail.csv}

= \starttext
=C2=A0 =C2=A0 \filelineaction
\stoptext



--
Atentamente

= DesdeChaves
--001a1146a13cb614f4054639bf76-- --===============2310393487921544159== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX18KSWYgeW91ciBxdWVzdGlvbiBpcyBvZiBpbnRlcmVz dCB0byBvdGhlcnMgYXMgd2VsbCwgcGxlYXNlIGFkZCBhbiBlbnRyeSB0byB0aGUgV2lraSEKCm1h aWxsaXN0IDogbnRnLWNvbnRleHRAbnRnLm5sIC8gaHR0cDovL3d3dy5udGcubmwvbWFpbG1hbi9s aXN0aW5mby9udGctY29udGV4dAp3ZWJwYWdlICA6IGh0dHA6Ly93d3cucHJhZ21hLWFkZS5ubCAv IGh0dHA6Ly9jb250ZXh0LmFhbmhldC5uZXQKYXJjaGl2ZSAgOiBodHRwczovL2JpdGJ1Y2tldC5v cmcvcGhnL2NvbnRleHQtbWlycm9yL2NvbW1pdHMvCndpa2kgICAgIDogaHR0cDovL2NvbnRleHRn YXJkZW4ubmV0Cl9fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19f --===============2310393487921544159==--