Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi expert
I need to rename the fields in the following table
Tabla2:
period.20101
period.20102
period.20111
period.20112
period.20121
period.20122
period.20131
....
....
Resident Table1;
Drop Table Table1;
I do not always have all the fields, it is possible that in a set I do not get the period.20101, I need to remove the word period and leave only the number
Rename like this - period.20101 as 20101
You can hide this 'period.20101' by putting // in front.
Thank you!
You could do something like below
Set vTableName='Table1';
Set i=1;
Do
Let xx=NoOfFields('$(vTableName)');
Let FromField=FieldName($(i),'$(vTableName)');
Let ToField=Keepchar('$(FromField)','0123456789');
RENAME Field '$(FromField)' to '$(ToField)';
Let i=$(i)+1;
Loop While $(i)<=NoOfFields('$(vTableName)');