- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Rename Data Table Script
I know I can rename a data data table script using dt << Rename Table Script("Old","New"); But I want to rename more than one scripts and I am trying to rename all the scripts starting from the third script in the data table with the column names I acquired from a different table. Can anyone point me out to my mistake since I am getting no error in my log. Thank you.
a1 = dt << getTableScriptNames;
show(a1);
names = dt1 << get column names(String);
for( i=3, i <= N Items( a1 ), i++,
dt << Rename Table Script(a1,Name);
show(a1);
);
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Rename Data Table Script
@Aam_jmp,
A couple of things, you will need to index into the list of names , not use the list as a whole.
for(i = 3, i <= N Items(a1), i++,
dt << Rename Table Script(a1[i],Names[i]);
);
Another thing, I would keep in mind is if you are starting from i = 3, Are you sure you want to be naming starting from the 3rd column of dt1 - if yes, the above should work.
Uday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Rename Data Table Script
@Aam_jmp,
A couple of things, you will need to index into the list of names , not use the list as a whole.
for(i = 3, i <= N Items(a1), i++,
dt << Rename Table Script(a1[i],Names[i]);
);
Another thing, I would keep in mind is if you are starting from i = 3, Are you sure you want to be naming starting from the 3rd column of dt1 - if yes, the above should work.
Uday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Rename Data Table Script
Thanks for the quick response. @uday_guntupalli I realized I missed out on indexing. I want to rename the table scripts beginning the third script, taking the first column name i.e. a[3] = Name[1]. How can I do that?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Rename Data Table Script
@Aam_jmp,
Simplest way I can think of is:
for(i = 3, i <= N Items(a1), i++,
dt << Rename Table Script(a1[i],Names[i-2]);
);
However, irrespective of the approach you will need to ensure that as there are sufficient items in Names for you to do this.
Uday
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content