Is it possible to declare in TeX array of integer numbers ? What I am trying to do is to declare new tabular environment for very long tables spanning accross multiple columns and (or) pages. My current solution looks like this (simplified):
\begin{tabular}{>{\ttfamily}p{2cm}>{\ttfamily}p{2cm}>{\ttfamily}p{2cm}}
\toprule
\myth{Začiatok úseku}&\myth{Koniec úseku}&\myth{Hodnota} \\
\midrule
\partialinput{2}{27}{data/KrivkaTvorivosti.csv}
\bottomrule
\end{tabular}
\begin{tabular}{>{\ttfamily}p{2cm}>{\ttfamily}p{2cm}>{\ttfamily}p{2cm}}
\toprule
\myth{Začiatok úseku}&\myth{Koniec úseku}&\myth{Hodnota} \\
\midrule
\partialinput{28}{53}{data/KrivkaTvorivosti.csv}
\bottomrule
\end{tabular}
\begin{tabular}{>{\ttfamily}p{2cm}>{\ttfamily}p{2cm}>{\ttfamily}p{2cm}}
\toprule
\myth{Začiatok úseku}&\myth{Koniec úseku}&\myth{Hodnota} \\
\midrule
\partialinput{54}{79}{data/KrivkaTvorivosti.csv}
\bottomrule
\end{tabular}
Macro partialinput is defined here. Every part of long table defined in tabular environment reads particular part of external CSV file based on row indexes. This is relatively convenient in comparison with pure LaTeX but with very long tables consisting of many parts its tedious task to correctly set begin & end row indexes for every part. With increasing number of sections the probability that I make error somewhere rises. When doing error somewhere in the beginning I had to recalculate row indexes for all sections that follow. Currently long table I print is consisting from 12 sections ! Sometimes it happens that content must be moved a few lines above or below and every time I had to go through 12 tabular environments and calculate correct indexes. It would be good for me to declare array with number of rows for every sections something like
\DeclareArray SectionLengths={20,20,20,20,30,30,30,30,10,10,10,10}
and the define new environment longtabular which would iterate through this array and calculate begin & end row index for current section automatically. Is it possible using TeX or LaTeX ?