From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/36658 Path: news.gmane.org!not-for-mail From: Aditya Mahajan Newsgroups: gmane.comp.tex.context Subject: Re: merging data from four files in one document Date: Wed, 19 Sep 2007 09:48:41 -0400 (EDT) Message-ID: References: <46F11A65.9000007@jhnet.nl> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1190209789 16940 80.91.229.12 (19 Sep 2007 13:49:49 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 19 Sep 2007 13:49:49 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Wed Sep 19 15:49:38 2007 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1IXzvR-0000D0-6F for gctc-ntg-context-518@m.gmane.org; Wed, 19 Sep 2007 15:49:09 +0200 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3BC982006B; Wed, 19 Sep 2007 15:49:06 +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 22043-01-10; Wed, 19 Sep 2007 15:48:53 +0200 (CEST) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id ECB7A2005C; Wed, 19 Sep 2007 15:48:52 +0200 (CEST) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id B58942005C for ; Wed, 19 Sep 2007 15:48:49 +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 22043-01-9 for ; Wed, 19 Sep 2007 15:48:44 +0200 (CEST) Original-Received: from hackers.mr.itd.umich.edu (smtp.mail.umich.edu [141.211.14.81]) by ronja.ntg.nl (Postfix) with ESMTP id E767720051 for ; Wed, 19 Sep 2007 15:48:43 +0200 (CEST) Original-Received: FROM aditya.annarb01.mi.comcast.net (adsl-68-79-103-226.dsl.sfldmi.ameritech.net [68.79.103.226]) BY hackers.mr.itd.umich.edu ID 46F128B9.604DB.30874 ; 19 Sep 2007 09:48:41 -0400 In-Reply-To: <46F11A65.9000007@jhnet.nl> X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 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-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:36658 Archived-At: On Wed, 19 Sep 2007, Jelle Huisman wrote: > Hi all, > > I try to merge data from four files in one document. The source files > are simple text files, each with 420 numbered lines of text. I have > created a simple natural table with cells for the different pieces of > data. I would like to make one document with 420 tables, each with the > right data from the four source files (so Table 1 with data from line 1 > from file One and line 1 from file Two and line 1 from file Three and > line 1 from file Four, and next Table 2 with data from line 2 from file > One and line 2 from file Two et cetera...) What is the best way to > automate this process? Write a script in your favourite language to create the 420 natural tables. Then call your script from ConTeXt and then use \write18 or \executesystemcommand to run it (See http://wiki.contextgarden.net/executesystemcommand and http://wiki.contextgarden.net/Write18), and then \input the file that is created. You can also do the whole thing in TeX, but IMHO it is not worth the effort. An alternative may be to use LuaTeX, where you write your script in lua, and execute it directly in luatex. This will have a slight speed advantage. Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________