ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
From: Aditya Mahajan <adityam@umich.edu>
To: mailing list for ConTeXt users <ntg-context@ntg.nl>
Subject: Re: merging data from four files in one document
Date: Wed, 19 Sep 2007 09:48:41 -0400 (EDT)	[thread overview]
Message-ID: <alpine.WNT.0.9999.0709190941040.3688@nqvgln> (raw)
In-Reply-To: <46F11A65.9000007@jhnet.nl>

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
___________________________________________________________________________________


  reply	other threads:[~2007-09-19 13:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-19 12:47 Jelle Huisman
2007-09-19 13:48 ` Aditya Mahajan [this message]
2007-09-20  8:42   ` Jelle Huisman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.WNT.0.9999.0709190941040.3688@nqvgln \
    --to=adityam@umich.edu \
    --cc=ntg-context@ntg.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).