|
[Sponsors] |
September 11, 2009, 13:47 |
perl script error (looping)
|
#1 |
New Member
al mazdeh
Join Date: Mar 2009
Posts: 16
Rep Power: 17 |
Can anyone show me how to loop through files in perl? Or cfx
I know how to use loops-but I like to apply it on files with names in numeric orders foe exampleslike PLATEJET_InCompress_1.def PLATEJET_InCompress_2.def PLATEJET_InCompress_3.def I wrote a script file- that gives me one error when it tries to rewrite the file after each loop- i have highlighed it below COMMAND FILE: CFX Pre Version = 11.0 END !$num_files = 2; ! for ($i=0; $i < $num_files; $i++) { ! $n = $i + 1; ! $filename = "PLATEJET_InCompress_" . $n . ".def"; >load filename=$filename , mode=def, recoverSession=no, replaceFlow=yes, overwrite=yes > update >importccl filename=change.ccl, mode = append, autoLoadLibrary = none >writeCaseFile filename = "PLATEJET_InCompress_" . $n . ".def", operation=write \ solver file > update >close, deleteLibrary = On > update !} |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Perl script for intialisation | pratik mehta | CFX | 2 | September 10, 2008 04:09 |
Is Perl installed with CFX? | Rikio | CFX | 4 | May 28, 2008 04:33 |
Solver Control via .pre file with Perl script | ahlo | CFX | 1 | March 7, 2008 13:33 |
Time-steps via Perl in CCL | Rui | CFX | 5 | March 29, 2004 01:47 |
linking the script | Mavinakere | FLUENT | 0 | September 12, 2002 12:57 |