Need to rename file placed in network location

HI,

So I tried running this command :
\r /abc/dd/rrr.csv /abc/dd/ttt.csv
This works perfectly fine but when I try to store in some variable which is of string type and try like this :
oldFileName : “rrr.csv”;
newFIleName : "ttt.csv;
\r oldFileName newFileName

This doesn’t work as now it is a string. Even I tried using hsym :
\r  (hsym $oldFileName)  (hsym $newFileName)

This also didn’t work. Any idea of how can I rename using varaiable.  

Hi Shashwat,

You can use ‘system’ as a key word instead of backslashes to execute system commands, passing the argument as a string. This allows us to use variables in the command, for example:

system "r “,oldFileName,” ",newFileName

Will execute what you wish above. Is this the kind of thing you were looking for?

More info: https://code.kx.com/q/ref/system/

Thanks,

Daniel

Thanks.. That worked