From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/22686 Path: news.gmane.org!not-for-mail From: Christopher Creutzig Newsgroups: gmane.comp.tex.context Subject: Re: Antwort: Re: XML Date: Fri, 23 Sep 2005 21:33:02 +0200 Message-ID: <4334586E.4040804@creutzig.de> References: <20050923150329.14468@mail.comp.lancs.ac.uk> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1127504314 27273 80.91.229.2 (23 Sep 2005 19:38:34 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 23 Sep 2005 19:38:34 +0000 (UTC) Original-X-From: ntg-context-bounces@ntg.nl Fri Sep 23 21:38:32 2005 Return-path: Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by ciao.gmane.org with esmtp (Exim 4.43) id 1EItLq-0004BU-01 for gctc-ntg-context-518@m.gmane.org; Fri, 23 Sep 2005 21:36:54 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 96E5A12775; Fri, 23 Sep 2005 21:36:53 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11741-05; Fri, 23 Sep 2005 21:36:53 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3A05112798; Fri, 23 Sep 2005 21:33:18 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id D3DBC12798 for ; Fri, 23 Sep 2005 21:33:16 +0200 (CEST) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 11707-04 for ; Fri, 23 Sep 2005 21:33:15 +0200 (CEST) Original-Received: from mailgate.uni-paderborn.de (mailgate.uni-paderborn.de [131.234.22.32]) by ronja.ntg.nl (Postfix) with ESMTP id E421512775 for ; Fri, 23 Sep 2005 21:33:15 +0200 (CEST) Original-Received: from p548b0e69.dip0.t-ipconnect.de ([84.139.14.105] helo=[192.168.1.2]) by mailgate.uni-paderborn.de with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.43) id 1EItJA-000141-F6 for ntg-context@ntg.nl; Fri, 23 Sep 2005 21:34:08 +0200 User-Agent: Mozilla Thunderbird 1.0.6 (Macintosh/20050716) X-Accept-Language: en-us, en Original-To: mailing list for ConTeXt users In-Reply-To: <20050923150329.14468@mail.comp.lancs.ac.uk> X-Enigmail-Version: 0.92.0.0 X-UNI-PB_FAK-EIM-MailScanner-Information: Please see http://imap.uni-paderborn.de for details X-UNI-PB_FAK-EIM-MailScanner: Found to be clean X-UNI-PB_FAK-EIM-MailScanner-SpamCheck: not spam, SpamAssassin (score=-3.208, required 4, AUTH_EIM_USER -5.00, RCVD_IN_NJABL_DUL 1.66, RCVD_IN_SORBS_DUL 0.14) X-MailScanner-From: christopher@creutzig.de X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.5 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on smtp.ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:22686 Archived-At: Adam Lindsay wrote: > I'm not sure I understand the "CVS or something else" part from the Probably a typo for CSV, comma-seperated values. It should be rather easy to typeset csv data in table format. The following tentative code ignores the fact that csv data may optionally be enclosed in "" quotes that have to be removed (to be done in TBLentry) and that these quoted strings may contain commas themselves (which means writing a custom version of \processcommalist instead). Apart from that, it seems to work. (I just felt an urge of creativism, so I took up the challenge.) \def\TBLentry#1{\bTD#1\eTD} \def\TBLline#1{\bTR\processcommalist[#1]\TBLentry} % Iterate over all the lines of text captured with \obeylines active % command to call is first argument, is not called for empty lines \bgroup \obeylines \gdef\ProcessLines#1#2{\doProcessLines{#1}#2^^M\doProcessLines}% \gdef\doProcessLines#1#2^^M#3\doProcessLines{% \doifnotempty{#2}{#1{#2}}% \doifnotempty{#3}{\doProcessLines{#1}#3\doProcessLines}% }% \egroup \def\startCSV{\bgroup\obeylines\dostartCSV} \def\dostartCSV#1\stopCSV{% \bTABLE \ProcessLines\TBLline{#1}% \eTABLE \egroup } \starttext CSV test: \startCSV a,b,c,d,e 1,2,3,4,5 6,7,8,9,10 some text,11,12,,14 \stopCSV \stoptext Hans, what goodies of ConTeXt did I miss? Is the above sufficiently ConTeXtish to be wikiable? regards, Christopher