4

I have had a quick look for similar questions but I couldn't find anything, so apologies if this is a duplicate.

Firstly, I am looking for a way to grab information from external source files (i.e. query1.sql) which will then be formatted with language-specific highlighting (SQL in this case).

Secondly, I would like to grab information from an external csv file and have it formatted into a table.

I am using external files so that they can be updated automatically by an Automated Build process so that we have documentation that is always up to date.

As an example, I am looking for something like this:

Using the below script:

select *
from table;

We receive the output:

1 | 2 | 3
_________
a | b | c
d | e | f
12
  1. The listings package can input external files and format them. It already has language definitions for SQL source.
  2. The datatool package can read CSV files so that they can be used in tables.
  • Awesome, thanks Alan, that is just what I was after. – josh-fuggle Apr 21 '11 at 4:18
  • Sorry, it looks like I can't vote up on this account. :( – josh-fuggle Apr 21 '11 at 4:19
  • Besides datatool, there're also pgfplotstable and csvsimple. – Leo Liu Apr 21 '11 at 4:41
  • @Leo Liu Thanks Leo, I'll take a look into those as well :) – josh-fuggle Apr 21 '11 at 4:44
  • @Leo It's a shame that the documentation for csvsimple is only in German. (Although one can probably figure most things out from the examples.) – Alan Munn May 7 '11 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.