I have a text file in the format (space delimited, one entry per line):
row1 val1 val2
row2 val1 val2
I have the header values for the table within an array, say fieldArray.
I need to create a LATEX table similar to this (added a screenshot below because table is not displaying properly):
header 1 | header 2 | header 3 |
---|---|---|
row1 | val1 | val2 |
row2 | val1 | val2 |
row3 | val1 | val2 |
In the table above, the headers come from the array, and the 'row' & 'val' comes from the lines in the .txt file.
I need to make the table from the .txt and the fieldArray within my shell script and put it into a file called 'temp.tex', then I need to use pdflatex to create a pdf of the table from that .tex file and call it 'table.pdf' (All within a single script).
Though, in the shellscript, the .txt file is not always the same. The .txt changes depending on what the user inputs when they call the script.
Desired table: