Question

attribute renaming using attribute values

  • 26 September 2013
  • 8 replies
  • 3 views

I have an excel file and the 2nd row contains the attirbute name that I want as cattirbute names.  I can read in and sample and start reading at the 2nd row to get the values that I want as attribute names, and the default attribute names are F1, F2...F12,F13.  I want to replace the F1,F2...F11,F12 attribute names with the value in the attribute name F1, F2 etc.

 

 

I have tried but no success, I am sure it is simple to do...I know that you can import attribute names from a file...but the column names will change as some of the column names will be based on the last 6 months so a new month will be in column F6,F7..F11,F12.  So i need to retrive the attirbute names from the row 2 in the file.

 

THanks, Steve

8 replies

Userlevel 4
Badge +13
Hi,

 

 

If you specify that the second row contains the attribute name, while inserting the reader(parameters button), FME will treat the second row as the attribute name.

 

 

(or am I missing something?)
first I am on build 2013 SP@ build 13499-win32, just in case that is a problem.  I don't see a way to indicate that in the parameters settings, i can yes or no for field names on first row...but I don't see any box to enter what row the field names are on. you have 'file path', ;field names on first row', 'show named ranges', 'table list', 'where clause', 'additional attributes to expose' and that is all I see.  

 

Userlevel 4
Badge +13
Try the new xls reader , in the range box you can specify row 2 (although I'm pretty sure it can be done with the old reader too...  Just not behind fme atm)
Userlevel 4
Badge +13
Found this:

 

http://cdn.blog.safe.com/wp-content/uploads/2013/06/newexcelsp2.png

 

 

set fields names row = 2
well I have found the reason that I don't see the box to set which row is field names and you see it...I am picking the 'microsoft excel ADO(deprecated)' which does not give the choice for field name row...however when I pick the 'microsoft excel'  and click the parameters button the window opens and after ~ 30 secs or so FME crashes...so I never get the choice to pick the sheets to read and etc...My file is ~ 330 Meg and ~ 15 worksheets...and some worksheets contain ~ 500K rows of ~ 20 columns worth of data...I guess FME can't handle lots of data like it suppose to..I tried a couple of other workbooks that contain a lot less worksheets and rows and it worked fine.  The reason that I am using FME is because of the amount of data I need to process.

 

Thanks for your help...Is there another way to take the values and make them attribute names after I read the file?

 

 

Userlevel 4
Badge +13
Firstly I would let safe know about this issue, they are always interested in this kind of problems.

 

Secondlypossibly the log file can provide more information ( unless FME really shuts down without logging the problem )

 

and lastly you can try ro remove some not relevant data and try again.
it shuts down completely and the program goes away, and no log event messages that I am aware of...I will report to FME...thanks for your help!   I can read the file and the worksheet in that I want but I have to manually import the attributes names each time i read a new set of data. 

 

Userlevel 4
Badge +13
Just wondering if it is a memory issue, is the file located at a remote network location?

 

Do you have enough memory resources on your machine?

 

See the following for possible improvements:

 

http://fmepedia.safe.com/articles/FAQ/FME-TEMP-environment-variable

 

http://fmepedia.safe.com/articles/How_To/Performance-Tuning-FME#heading_toc_j_9

Reply