How to add a string to a path of file which is changing in each loop in imagej macro language?

fiji
imagej
plugin

#1

I have some csv files that are saved in my computer like x1,x2, x3, and so on. I want to call them and open them in for loop. here is my code:

xn="x"+j;
csvpathx="/C:/Users/Zeynab/Desktop/Trash/outputcsv/"+xj+".csv";
open(csvpathx);
}


The error i get: This is not a tab or comma delimited time.
I tried this one: 
```csvpathx="/C:/Users/Zeynab/Desktop/Trash/outputcsv/"+xj+".csv";
but didnot work as well.

Automated addition to ROI manager. Any sample code?
#2

Hey @Zeynab_Mousavi,

would you mind sharing on of the files? Furthermore, you are setting the variable xn = ... in your first line, but in the second line, your variable is called xj. May that be a typo?

Cheers,
Robert


#3

@haesleinhuepf I made a mistake writing it here. Here the code I am running and error:


#4

@haesleinhuepfx3.csv (9.1 KB)


#5

Would you mind sharing the file x3.csv? Furthermore, why is there a curly bracket in line 5? Last but not least, why does the folder start with a / ?


#6

@haesleinhuepf Thanks so much for your quick response. I fixed all but I get the same error. I shared the file.


#7

Is this the same script as this one?


#8

@Andrew_Shum Yes. But I am curious to know the answer to my question regardless of other parts of the code.