1

I'm using an iterator in ModelBuilder (1) to merge files, using a feedback loop (2). The output file is named "Output_%n%.txt", (3), so each file is unique.

Now, I'm merging a fair number of files, so I'm trying to speed the process up. Since I don't care about the interim files, I can write them out to in_memory. But I would like to save the final file, viz: "Output_167.txt" to C:\myfile rather than in_memory.

(0) Yes, APPEND would work, but this has other applications.

(1) http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#//00400000001n000000.htm

(2) http://webhelp.esri.com/arcgisdesktop/9.3/index.cfm?TopicName=Iteration_using_feedback

(3) http://resources.arcgis.com/en/help/main/10.1/index.html#//002w0000005s000000

migrated from meta.gis.stackexchange.com Oct 24 '14 at 5:54

This question came from our discussion, support, and feature requests site for cartographers, geographers and GIS professionals.

  • How about you write them all to in_memory as you are then the next step is to write out the final dataset, you know what %n% is so it should be fairly easy to export out. I am surprised that the in_memory workspace allows that naming convention. – Hornbydd Oct 24 '14 at 7:51
  • @horbbydd. That does work, but I'm trying to generalize the tool in such a way that I can apply it to multiple tables of unknown length. I could use a count function or table properties to get the number of rows, and then export when x=%n%, but doing so would require using a nested model, so it didn't redo the count multiple times. – Mox Oct 27 '14 at 19:59
1

How about you write them all to in_memory as you are then the next step is to write out the final dataset, you know what %n% is so it should be fairly easy to export out. Hornbydd Oct 24 at 7:51

@Hornbydd Months later, I finally understand your reply. I could not think how to get n, realized that for this specific purpose, I'm using a FOR loop, with a model parameter. It will take some text slicing, but I can extract the n from %n%. For cases where I am not, such as iterating over rows in a data-set, I can use max(ID) to get the iteration count.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.