I am constructing a standard format PDF report and must follow that format (ie the table is in a particular format with colors and fonts etc etc). The format requires large tables to be populated with float data points which are held in a CSV file on my PC. This process is going to be automated eventually. There seems to be a number of ways of doing this but i am not sure which is the simplest. Ideally I would like to be able to "index into" myFile.txt eg x= load(myFile.txt), val1 = x(3,17); etc
How do I assign values from "myFile.txt" to my variables val1, val2, val3, val4?
thank you!
Code: Select all
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage{caption}
\usepackage{float}
\usepackage{xspace}
\usepackage{verbatim}
\usepackage{array}
\usepackage{multirow}
\usepackage{hhline}
\usepackage{ifthen}
%http://www.tug.org/texmf-dist/doc/latex/pgfplots/pgfplotstable.pdf
\newread\file
\openin\file=A:/myReports/latestResults/myFile.txt
\loop\unless\ifeof\file
\read\file to\fileline % Reads a line of the file into \fileline
% Do something with \fileline
\repeat
\closein\file
\begin{tabular}{|c|c|c|}
\hline
t1 & t2 & t3 \\
y1 & val1 & val4 \\
y2 & val2 & val3 \\
\hline
\end{tabular}
\end{document}