From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/97078 Path: news.gmane.org!.POSTED!not-for-mail From: DesdeChaves Newsgroups: gmane.comp.tex.context Subject: scancsv module and lua Date: Mon, 16 Jan 2017 17:35:13 +0000 Message-ID: Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1642636288815148655==" X-Trace: blaine.gmane.org 1484588156 21397 195.159.176.226 (16 Jan 2017 17:35:56 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 16 Jan 2017 17:35:56 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Mon Jan 16 18:35:51 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 1cTBCA-00056S-GU for gctc-ntg-context-518@m.gmane.org; Mon, 16 Jan 2017 18:35:50 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id A20EB1240412; Mon, 16 Jan 2017 18:35:27 +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 8dU4PJ42Wjcs; Mon, 16 Jan 2017 18:35:27 +0100 (CET) Original-Received: from zapf.ntg.nl (localhost [IPv6:::1]) by zapf.ntg.nl (Postfix) with ESMTP id 01F091240416; Mon, 16 Jan 2017 18:35:27 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by zapf.ntg.nl (Postfix) with ESMTP id 17F2D1240413 for ; Mon, 16 Jan 2017 18:35:25 +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 YREuMVOP1kmu for ; Mon, 16 Jan 2017 18:35:24 +0100 (CET) Original-Received: from mail-wm0-f42.google.com (mail-wm0-f42.google.com [74.125.82.42]) (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 9A9351240412 for ; Mon, 16 Jan 2017 18:35:14 +0100 (CET) Original-Received: by mail-wm0-f42.google.com with SMTP id c85so167649043wmi.1 for ; Mon, 16 Jan 2017 09:35:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=PE9UGSttg35t1gvhs8BdPzk06xnfL/zX4OvsczcTcR0=; b=Y/w4yT51KDWQXPrz8NBa5v2L1O8ChVaVSSO7qAHIeaem7PWIaZzeeceGNRBwp5EtGA PJLmXJBnJAUxAyWGPz730/2WvvoFLbVxj32Fys+d4c99ZTCBi78tRcO23rBreMFgSzPI XnhPqtUKg3vGMFdCDwfufqRwgChx9BZELt9nq5maCMMaBxRVs5mEsvFIVP3KYEcrokiR WN7+kka5uLhOxuQrfScxKSMXBqWvsWyDzG7F9HrQhQOT3qo24GKOw7bzfzlvQnUG18wC kAyZF+oduL1XWeNZQu6Url10B4zNwLxIXYBIvjjbCbJasKodNgmCbA4knETnGbNtwpsy op7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=PE9UGSttg35t1gvhs8BdPzk06xnfL/zX4OvsczcTcR0=; b=T+5CLE7fAvzYuQagLgh4DjOSvLP2ZpVZi+GS/MbGq0HP65gRNZrh4AbkEEg49eB0dt 0z1EfMily0edZMOO/UdDgv8mE2FPpbE2vhCVU2Mi4OZ6II3HKSp5qNKRn5dfBsQezgQM vVJsUATD9nDffm/CUUoIxPZFN5OxqgASMY/szDZwfdoYAOvMCUNxFqCTfRzdF6WYnh7X SIeJ1zIk71145I0JL1gT4T3X0+4u13huBmGt6KbYmUqbQVXbr/vK2LJRttpxZKctutYQ JO7aZCFJJngQQ8Xmn9m3b4zfmOILUZ9WLoiE2XkSK7w+eWPI+D7mtMKyfAI/hbbdfZSz zPeg== X-Gm-Message-State: AIkVDXJeZru4B2XnOgG/Iv6mwyKodijlduo54bKkg/7lrc0lsABrM6P5eXo/X30ZnvHzFShKtY372EjpL972kg== X-Received: by 10.28.158.74 with SMTP id h71mr13745520wme.59.1484588114029; Mon, 16 Jan 2017 09:35:14 -0800 (PST) Original-Received: by 10.28.95.2 with HTTP; Mon, 16 Jan 2017 09:35:13 -0800 (PST) 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:97078 Archived-At: --===============1642636288815148655== Content-Type: multipart/alternative; boundary=001a114b39862cb0bd0546399bd4 --001a114b39862cb0bd0546399bd4 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 formatted inside luacode environment, but the text.print("") and the context("") functions don=C2=B4t be able to send the formatted data to the output. The 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 --001a114b39862cb0bd0546399bd4 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Dear sirs,

=
In my project I need to format some data from a csv file. T= he csv file is scanned using the scancsv module and part of this informatio= n is formatted inside luacode environment, but the text.print("")= and the =C2=A0context("") =C2=A0functions don=C2=B4t be able to = send the formatted data to the output. The 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 - dat= e, #2 - old separator, #3 - new separator
\startlua
=C2= =A0 =C2=A0 =C2=A0local parsedate=3Dthirddata.scancsv.ParseCSVLine('#1&#= 39;,'#2');
=C2=A0 =C2=A0 =C2=A0local day=3Dtonumber(parse= date[1]);
=C2=A0 =C2=A0 =C2=A0local month=3Dtonumber(parsedate[2]= );
=C2=A0 =C2=A0 =C2=A0local year=3Dtonumber(parsedate[3]);
=
-- =C2=A0 =C2=A0 tex.print(day..'#3'..month..'#3'..yea= r);
=C2=A0 =C2=A0 =C2=A0text.print("Hello");=
\stoplua
}

\unexpanded\def\li= neaction{
=C2=A0 =C2=A0 =C2=A0\Name\ arrived on \ddmmyyyy{\Date}{= /}{.\\,} \\
}


% =C2=A0 = =C2=A0 Name;Date
% =C2=A0 =C2=A0 ME;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 \setsep{;}
=C2=A0 \setfil= etoscan{mail.csv}

\starttext
=C2=A0 =C2= =A0 \filelineaction
\stoptext
--001a114b39862cb0bd0546399bd4-- --===============1642636288815148655== 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 --===============1642636288815148655==--