how to read "results" files?
Posted by
chenyanpei on
Jul 05, 2010; 8:49am
URL: http://imagej.273.s1.nabble.com/how-to-read-results-files-tp3687722.html
Dear all,
I want to read the ImagJ results files,
the code is following:
dirtxt=getDirectory("file name ");
listtxt = getFileList( dirtxt );
setBatchMode(true);
nbr_txt = listtxt.length;
for (i = 0; i < nbr_txt; i++)
{
showProgress(i+1, listtxt.length);
run("Results... ", "open=dirtxt+ listtxt[i]");//I try to open as a txt file, but after i open it ,the
// spacebar dispear;
filestring=File.openAsString(pathfile);
rows=split(filestring, "\n");
x=newArray(rows.length);
y=newArray(rows.length);
for(i=1; i<rows.length; i++){
columns=split(rows[i],"\t");
x[i]=parseInt(columns[1]);
y[i]=parseInt(columns[2]);
print(x[i]+" "+y[i]+"\n");
} }
but there are some error"text.substring(7)". What is the problem? Thank you.