0

I have csv database loaded in data variable. I am trying to fetch value from particular column given an another column name and its value. I am using following code

\forloop{i}{1}{\value{i} < 30}
{
 \DTLfetch{data}{Number}{\value{i}}{Day}
}

Above code works well when there is hard coded numerical value like 1,2,3,... but somehow it is not able to catch the value of argument \value{i}. What am I not doing right?

1 Answer 1

1

The macro \value gives the value of the counter as an internal integer. This is fine if you compare it with another integer as in {\value{i} < 30}, but for \DTLfetch you need the representation of the number in arabic numerals, not just some internal integer. So you can use

\forloop{i}{1}{\value{i} < 30}
{
 \DTLfetch{data}{Number}{\arabic{i}}{Day}
}

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .