CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Visualization & Post-Processing Software > Tecplot

Run a macro on multiple files in a loop, and saving them with a new name

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 2, 2020, 23:36
Default Run a macro on multiple files in a loop, and saving them with a new name
  #1
New Member
 
Carlota
Join Date: Feb 2019
Posts: 1
Rep Power: 0
Carlotaaa2 is on a distinguished road
Hi,

I am trying to write a Macro and script, which ideally, would do:
- Open file "filename_X" (where X is a number)
- Edit it (this part is done; I am calculating new variables)
- Write the data into a file named "filename_X_Edit.dat"
for multiple files.

I would like to be able to run the script on multiple files, all named "filename_1", "filename_2", "filename_3"... and get the new files "filename_1_Edit.dat", "filename_2_Edit.dat", "filename_3_Edit.dat"... after running my macro on them.

Should the opening/closing of the files be included in the macro, or should that be in the wrapper shell script used to run it on all the files? I am new to both macros and Python, so I am a little confused as to what to do.

I am thinking the best way to do this is to have a script that gets the filename, opens it, and runs the Tecplot macro on it, and then saves the new data into a new file. However, I don't know how to do this.

I am looking at this wrong? Is there a better way to do this?

Thank you!
Carlotaaa2 is offline   Reply With Quote

Reply

Tags
macro, tecplot

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
UDF: saving multiple files Persil Fluent UDF and Scheme Programming 1 March 3, 2014 10:17
Movie Macro in Tecplot TedBrogan Tecplot 2 February 4, 2011 10:59


All times are GMT -4. The time now is 08:00.