How to add field names via model builder

3395
6
Jump to solution
06-28-2012 01:28 PM
MarkVolz
Occasional Contributor III
Hello,

Is there a way to add field names (column headers) via model builder?  I have an input table that I will be reviving each month, and there are no field names.  Therefore ArcGIS is interpreting the first row of data as the field names, instead of actual data.
0 Kudos
1 Solution

Accepted Solutions
EricRice
Esri Regular Contributor
I think what he is getting at Shitij is that he doesn't have a schema to begin with. His table is only data without field names. Table to Table will interpret the first row of 'data' as the 'fieldname', correct? I don't think we have a tool to do what he is asking for. We expect you to have field names in your table prior to input into any tool.

How do you know what the data represents without field names when just working in Excel? Is it common practice to omit field names from spreadsheet data? 

Regards,
Eric

View solution in original post

0 Kudos
6 Replies
ShitijMehta
Esri Regular Contributor
Is this table an excel sheet?
0 Kudos
HenrikSvenningsen
Occasional Contributor
if its in the attribute table, just use the "Add field" tool like i did in the attached picture.
0 Kudos
MarkVolz
Occasional Contributor III
@GEOSTUV03
The data is in an excel file.  I realize that i could manually add a row in excel.  However, since I will be dealing with several tables, and updating the data somewhat frequently, it would be more convenient and less problematic to approach this through model builder.

@shitijmehta
I am trying to figure out if I can add field names (row) not another field (column)
0 Kudos
ShitijMehta
Esri Regular Contributor
Ok - Row
Why a new row.?
What do you want to put in your new row? How many field (columns) exist in your excel?

Meanwhile try this:


  • If you want to use it in your model use the Table To Table tool to first convert the excel to a table in a file geodatabase. This will ensure all the other tools work well with your table in a file geodatabase.

  • Once you have a table make a copy of it. Delete all but one record (or as many as you want). Delete the contents of the row if you want empty row.

  • We make a copy of this so that schema (fields) are same as the incoming table.

  • Then use the Merge tool to merge the original and the copied empty table.


  • Note - The schema of the incoming tables should be consistent every time to Merge the incoming and this copied table.


  • Use Iterate Tables iterator to iterate over more then one table.

0 Kudos
EricRice
Esri Regular Contributor
I think what he is getting at Shitij is that he doesn't have a schema to begin with. His table is only data without field names. Table to Table will interpret the first row of 'data' as the 'fieldname', correct? I don't think we have a tool to do what he is asking for. We expect you to have field names in your table prior to input into any tool.

How do you know what the data represents without field names when just working in Excel? Is it common practice to omit field names from spreadsheet data? 

Regards,
Eric
0 Kudos
MarkVolz
Occasional Contributor III
Eric,

Thanks for your reply.  Sounds like I will have to manually clean up the table in excel and add field names in there.
0 Kudos