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
Filename of output according to input filename
Hello again,
Within my workflows I often encounter the problem that i want to preprocess my files and then write them to another output file.
Is there the possiblity to take the input filename from the Read module (for example data_jun_2010.xls) and automatically generate the output filename for the write module at the end of te workflow (for example data_jun_2010_out.cls)?
Best regards,
Markus
Within my workflows I often encounter the problem that i want to preprocess my files and then write them to another output file.
Is there the possiblity to take the input filename from the Read module (for example data_jun_2010.xls) and automatically generate the output filename for the write module at the end of te workflow (for example data_jun_2010_out.cls)?
Best regards,
Markus
0
Answers
you might use Macros for this: Store the file name into a macro, use %{macro_name}.xls for reading and %{macro_name}_out.xls for putting it out again.
With Macro Construction you can even modify your macros in a more sophisticated way, for example cutting the .xls and appending it again...
Greetings,
Sebastian
Unfortunately I could not find an example process where the usage of a macro like this is described. Could you give me an example workflow doing something like this:
Read something and Write it as [date]_originalname.csv
Thanks a lot in advance,
Markus
Seb beat me to it again, drats! This logs your files..
I read the conversation between Ingo and you in the last thread and I can say that I tried to find a solution myself searching through the forum and going through the tutorial files.
I really appreciate your help.
Markus
Cool, I realised that an answer was not available, and was glad to help - don't forget I learnt something too!
Happy mining!
Cheers,
Ingo
Is there a way way to export the variable for path and filename out of the loop?
Markus
However, if you mean if it possible to collect all paths and filenames within a loop and make those available to the process outside of the loop: yes, that's possible by logging the macros and creating a data table from the process log table after the loop. But that's probably not what you are after since you would get the same result with a simple "dir" / "ls" command
Cheers,
Ingo
I used to do 1 to 20 day forecasts on 1000+ things, and used parameter looping as the way to impose order on those pesky files ( parameters mainly ); I've wrapped my previous offering in a parameter iteration to show the point... Any use?