Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi everyone,
i have a problem. I'd like to convert Column Header Name to Upper.
I use a loop to read all excel files.
FOR each File in filelist('lib://Input/'& '\*.xlsx')
TABLE1:
LOAD
*
FROM [$(File)] (ooxml, embedded labels, table is Sheet1);
TABLE2:
LOAD
*
FROM [$(File)] (ooxml, embedded labels, table is Sheet2);
NEXT File
How I can convert all the column header name of all files to Upper case??
Thanks,
Livio
easiest way i can think of
For f = 1 to NoOfFields('ur table')
let oldName= FieldName($(f),'ur table');
let newName= upper( FieldName($(f),'ur table'));
Rename Field $(oldName) to $(newName);
Next f
easiest way i can think of
For f = 1 to NoOfFields('ur table')
let oldName= FieldName($(f),'ur table');
let newName= upper( FieldName($(f),'ur table'));
Rename Field $(oldName) to $(newName);
Next f
What is 'ur table'? The name of the Table? --> TABLE1 andTABLE2 in my code ...
yes
Ok, there are any problems with ' ' (blank space), but it's correct!
You can try something like:
for each table in 'TABLE', 'TABLE_2'
FOR i = 1 to NoOfFields('$(table)')
LET field = FieldName($(i), '$(table)');
LET newField=upper('$(field)');
TRACE '$(field) to $(newField)';
RENAME Field $(field) to $(newField);
next
next