I have written this code and it works:
...
\DTLsetseparator{;}
\DTLloaddb[noheader]{DBcurva}{Curvas.csv}
\begin{tikzpicture}
\foreach \columna in {1,3,...,\DTLcolumncount{DBcurva}}{
\edef\listaPuntos{}
\pgfmathtruncatemacro{\columnasig}{1+\columna}
\foreach \fila in {1,2,...,\DTLrowcount{DBcurva}}
{
\DTLgetvalue{\cX}{DBcurva}{\fila}{\columna}
\DTLgetvalue{\cY}{DBcurva}{\fila}{\columnasig}
\xdef\listaPuntos{(\cX,\cY) -- \listaPuntos}
}
\draw \listaPuntos cycle;
}
\end{tikzpicture}
...
This reads a CSV file called "Curvas.csv". The columns are coordinates of points on curves (X1,Y1,X2,Y2,X3,Y3,X4,Y4..). The code draws all the curves in the file (initially I don't know how many there are) without problems.
Is there a better way (I can't separate each curve in different files)?
