The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"writting a collection of documents"
mohammadreza
Member Posts: 23 Contributor II
Hi all,
I read an XML file in my process and convert it to a collection of documents in memory. Now I need to write each document as a separate file. Is there any way to do that? (I cam think of using "Write Document" in a loop but I can't figure out the right way to do that).
Best
I read an XML file in my process and convert it to a collection of documents in memory. Now I need to write each document as a separate file. Is there any way to do that? (I cam think of using "Write Document" in a loop but I can't figure out the right way to do that).
Best
Tagged:
0
Answers
what about either Document to Data or Combine Documents first?
Dortmund, Germany
The data is already combined in one big XML file so I am trying to break it down to several files and write them. The only remaining part is just writing the document collection (which is in memory) on hard drive: Here is my process so far: Thanks in advance
I say it is a simple example as it just uses the iteration of the loop operator as the filename. I would recommend you use either Extract Macro or Extract Macro from Annotation to get the name of the file you'd like it saved.
You might want to try the ID or the Author or a combination of the two?
Thanks. As you correctly mentioned, I need to save each file with its own name (id). According to your explanations (using Extract Macro) I came up with the following process, But I do not know what to choose for "example index" parameter of "Extract Macro operator" to be the "id" of each file.
Extract Macro can just be applied on example sets. So you might go with one big loop examples around and then extract the macro before converting it to a document,
Best
Martin
Dortmund, Germany