Skip to main content

rename column by position

Hi,
Is it possible to rename the column of a database based on its position rather than its name? For example, change the last column of a database to a standardised name.
I am looking for something similar to how you index by columns with a data.frame or matrix in R and Python. 
thanks,
Mike

klmi Fri, 10/11/2019 - 03:08

Hi mikew,
you didn't post any code example so I guess that you are using  TableDef.GetField("FIELDNAME") to find the field by it's name. Instead of applying TableDef.GetField("FIELDNAME") you can try TableDef.GetFieldAt(index) to access the fields by index. To get the last column or the number of fields in you database IDEA contains TableDef.Count.