2015.04.15 10:59 AM
\d .osWIN:.z.o in`w32`w64pth:{p:$[10h=type x;x;string x];if[WIN;p[where"/"=p]:"\\"];(":"=first p)_ p}cpy:{system$[WIN;"copy /v /z ";"cp "],pth[x]," ",pth y}del:{system$[WIN;"del ";"rm "],pth x}ren:{system$[WIN;"ren ";"mv "],pth[x]," ",pth y}here:{hsym`$system$[WIN;"cd";"pwd"]}\d .
renamecol:{[dbdir;table;oldname;newname] / renamecol[`:/k4/data/taq;`trade;`woz;`iz] if[not validcolname newname;'` sv newname,`invalid.newname]; rename1col[;oldname;newname]each allpaths[dbdir;table];}
rename1col:{[tabledir;oldname;newname] if[(oldname in ac)and not newname in ac:allcols tabledir; stdout"renaming ",(string oldname)," to ",(string newname)," in `",string tabledir; .os.ren[` sv tabledir,oldname;` sv tabledir,newname];@[tabledir;`.d;:;.[ac;where ac=oldname;:;newname]]]}
2015.04.15 11:09 AM
2015.04.15 11:21 AM
2015.04.15 11:54 AM
2015.04.15 12:23 PM
EMEA
Tel: +44 (0)28 3025 2242
AMERICAS
Tel: +1 (212) 447 6700
APAC
Tel: +61 (0)2 9236 5700
KX. All Rights Reserved.
KX and kdb+ are registered trademarks of KX Systems, Inc., a subsidiary of FD Technologies plc.