|
[Sponsors] |
Capturing the output from DOS system command using PERL in CFX Macro |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
May 17, 2016, 07:36 |
Capturing the output from DOS system command using PERL in CFX Macro
|
#1 |
Member
Dynampally Pavitran
Join Date: Mar 2010
Location: India
Posts: 74
Rep Power: 16 |
Hello all,
I have written a macro to calculate some values (which are not available as variables in CFD Post) and write the output to a file (File first row is Header, Second row consists values). I have to use the macro for several cases and values have to be appended to the same file. When the macro runs for the second time, it should skip writing the header portion and has to write values from third row. For this I am using DOS system command syntax in Perl to check whether the file exists or not in the working directory. The syntax used is: ! $CHECK = `If EXISTS XY.dat (ECHO YES) ELSE (ECHO NO)`; ! if ($CHECK == "NO") { print OFH "HEADER\n";} When backticks are used to capture system command output, CFD Post terminates. The same happens when "qx" syntax is used. Presently I am using alternative solution of asking the user input, whether the file is present or not? Could someone help me with the right syntax to capture system command output in PERL when used in CFX Macro. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CFX macro: Name of mesh File as Variable | Saima | CFX | 2 | May 27, 2011 19:59 |
Output to CFX | Maicol | CFX | 0 | April 13, 2011 18:48 |
Is Perl installed with CFX? | Rikio | CFX | 4 | May 28, 2008 04:33 |
Which operating system for CFX is the best? | Dr. Bian | CFX | 12 | June 26, 2006 09:58 |
CFX 4.4 installation problem | Pandu Sattvika | CFX | 1 | December 1, 2001 05:07 |