Renaming multiple data table from last word of current table nameHi, I am trying to rename multiple data table because my data table name are in directory forms. I would want to rename them according to their folder names (will be getting from the last character of the directory)
Sample data table name:
C:\Users\Desktop\Table1
C:\Users\Desktop\Table2
C:\Users\Desktop\Table3
I tried using Word function to get the last word from the file name, but doesn't work. Please help
For (w = 1, w <= N Table(), w++,
dtName = Word(-1, Data Table(w), "-"),
Data Table(w) << Set Name(dtName);
);
The resulting data table names should be: Table1, Table2, Table3
Automation and ScriptingRe: Renaming multiple data table from last word of current table nameYou need to retrieve the data table name
For (w = 1, w <= N Table(), w++,
dtName = Word(-1, Data Table(w) << get name, "-"),
Data Table(w) << Set Name(dtName);
);
Re: Renaming multiple data table from last word of current table nameWhy does it prompt an error like this?
too many arguments{40} in access or evaluation of 'For' , For/*###*/(w = 1, w <= N Table(), w++, dtName = Word(
-1,
Data Table( w ) << get name,
"-"
), Data Table( w ) << Set Name( dtName ))
--- EDIT ---
I replaced the comma after the Word function with ; and is working now
For (w = 1, w <= N Table(), w++,
dtName = Word(-1, Data Table(w) << get name, "-");
Data Table(w) << Set Name(dtName);
);