# How to use data from a file in tikz?

I am using TikZ and I want to produce several graphs from a data file. The file contains many lines with three numbers x y r. I want to use each line and draw a circle with \draw (\x,\y) circle(\r); where \x, \y and \r have been assigned the values read on a line. Is there a way to make a \foreach-like loop to make this ? I could change the lines into x/y/z if necessary to run something like

\foreachline \x/\y/\r in {filename} {
\draw (\x,\y) circle(\r);
}


Thanks

You could use something like datatool or csvsimple if you wanted:

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{\jobname.csv}
1, 2, 3
4, 5, 2
3, 1, 4
\end{filecontents*}
\usepackage{tikz,csvsimple}

\begin{document}