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

"How to Loop

dragonedisondragonedison Member Posts: 17 Contributor II
edited May 2019 in Help
Dear everyone,

I use "Loop Attribute Subsets" to implement the classification process, and I would like the classification result of each case in the dataset be stored, so I use the "Write CSV File" opererator to save it. However, I discovered that this operator doesn't implement an "attach" writing like the "Write as Text" operator, which means that each time this operator deletes the content of the file and write new results to it. I would like to know if there is any way to let the "Write CSV File" operator create a new file for writing results each time while keeping the old results.

I know that there is a "Loop Files" operator, but I don't know how to use it to implement this task.

Thanks.
Gary

Answers

  • colocolo Member Posts: 236 Maven
    Hi Gary,

    how about appending a counting value to the output filenames? You could initialize a counter just before the Loop operator is called (Generate Macro) and increment it inside the loop. If you append this macro to the filename for the CSV files you will get one file per loop run / case.

    This should easily solve the problem. Or did you expect something different (for example all contents in a single file)?

    Regards,
    Matthias

    PS. Loop files just works for existing files, it doesn't generate new ones.
  • dragonedisondragonedison Member Posts: 17 Contributor II
    Dear Matthias,

    Thanks for your advice! I will try.

    Regards,
    Gary
Sign In or Register to comment.