2.5.2 ⁑Sample XLS File
Most of the examples in this book will use data from either CSV files or SQL tables, but datatooltk can also import from Excel .xls files so there is one sample file, shop.xls, to illustrate this. The shop.xls file has two sheets called “products” and “customers”. The first sheet is shown in Figure 2.8. This has three columns. The second and third columns (“B” and “C”) have been set to a currency format. In addition, the third column contains formulae instead of an explicitly entered number.
The data can be fetched via datatooltk. For example, to fetch the data from the first sheet (“products”):
Or using an arara directive:
% arara: datatooltk: { % arara: --> output: products.dbtex, % arara: --> xls: shop.xls, % arara: --> sheet: products }
The resulting products.dbtex file can be loaded in your document using:
\DTLloaddbtex{\products}{products.dbtex}
You can also import Open Document .ods spreadsheets using a similar method to the above but you need to use --ods instead of --xls.
This book is also available as A4 PDF or 12.8cm x 9.6cm PDF or paperback (ISBN 978-1-909440-07-4).