Get filename

Hi all , I have one variable say icount=1 , I have one file in directory:“D\demo\op_1.txt”
now Im using readfile & putting my filepath as : “D\demo\op_”+icount.tostring()+“txt”
but is throwing invalid name error. So how can i chnage this syntax of filename?

I think you have missed dot in file path.

Try this

Hey Priyanka_tambe,

try it like this: “D\demo\op_”+icount.tostring()+“.txt”

Two strings need to concatenate by + sign

use + sign on both side, beginning and at the end

yes…thank you got it now

1 Like

Happy to hear @priyanka_tambe that this is resolved,Can you please mark the best solution among all comments and close this thread?