Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi Team,
I cant rename by columns to Upper case where the column headers start with a number.
For e.g., 3age to 3AGE.
I tried to use Text in the script, but it didnt help. demo code.
Test:
load * inline[
id,Name, 3Age
1,Romeo, 23
2, Juliet, 21
];
let vTotal=NoOfFields(Test');
For vCount=1 to $(vTotal)
Let vName=text(FieldName($(vCount),'Test'));
trace $(vName);
Let vName1=text(Upper(FieldName($(vCount),'Test')));
trace $(vName1);
Rename field $(vName) to $(vName1);
Next;
It gives below error :-
Syntax error
Unexpected token:'3', expected one of: 'using','IDENTIFIER','LITERAL_STRING','LITERAL_FIELD'
Rename Field >>>>>>3<<<<<<Age to 3AGE
Your field-names contain a special char and must be therefore wrapped, for example in this way:
Rename field [$(vName)] to [$(vName1)];
- Marcus
Hi,
Have you tried
RENAME FIELD OldFieldName TO NewFieldName;
RENAME FIELDS OldName1 TO NewName1, OldName2 TO NewName2, OldName3 TO NewName3;
Bill
Your field-names contain a special char and must be therefore wrapped, for example in this way:
Rename field [$(vName)] to [$(vName1)];
- Marcus
Hi @Bill_Britt, I tried that but it didnt help.
Hi @marcus_sommer,
Thanks! It worked.
The wrapping thing for columns is great. I almost forgot that.