Trying to make gnuplot like plotting tool in ROOT

Hi,
I am trying to write a small plotting application which I want to work similar to gnuplot…
for example gnuplot has this command

plot “Filename” using 1:2
And without knowing format string of file lines , it plots column2 vs column 1 .
Presently I am loading the file before plotting columns from it, where I take the file format string.
Can I do it like gnuplot, without any prior information about types of variables stored in file.

(new TGraph(“filename”, “%lg %lg”))->Draw(“AL”); // “%lg %lg” = 1:2, “%lg %*s %lg” = 1:3, “%*s %lg %lg” = 2:3

I am doing something similar to this…
However, in this way, one needs to provide the format string [quote]%lg %lg[/quote] of the file.
can I read the file “Filename.dat” without knowing its “format string” ??
basically, gnuplot is identifying the types of the ‘columns’ in the file in runtime ? Is there way to do that in root ?

“%lg %lg” is already the default format. You do not need to provide it.
see: root.cern.ch/root/htmldoc/TGraph.html