Skip to main content

Hi all,

 

I have a problem with extracting attributes list ordered previously with Attribute Manager.

I do it via Python Caller and exploding list which contains attributes names. It works OK but the order of these is sorted alphabetically and I need original pre-set by me order.

 def get_att_list(feature):   
    n1 = feature.getAllAttributeNames()
    x=0
    
    for n in n1:    
        print (x,n)
        feature.setAttribute('Attr_name{%d}' % x, n)
        x+=1

 

Generally speaking, I need to get numbers of columns in specific order to use it next in Excel vlookup formula. That is why the order is so important. Maybe there is a better way of doing it? 

I don't think it's possible to get the attribute names in the same order if they've been re-arranged in the attribute manager

https://knowledge.safe.com/questions/83013/python-getallattributenames-order.html


Perhaps you can use the Schemasetter and then reorder the list of schemas afterwards? A workaround, but still.


Perhaps you can use the Schemasetter and then reorder the list of schemas afterwards? A workaround, but still.

Could you tell me how to reorder schema?


Reply