CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   CFX (https://www.cfd-online.com/Forums/cfx/)
-   -   CCL code Row to Column (https://www.cfd-online.com/Forums/cfx/107609-ccl-code-row-column.html)

Cluain October 2, 2012 12:39

CCL code Row to Column
 
This CCL calculates wave height in Post and outputs it to a .csv excel file.
It places the data in a row, how can I change the code so that the data appears in a column?



LIBRARY:
CEL:
EXPRESSIONS:
WaveHeight=lengthInt(Water.Volume Fraction)@Line 1
END
END
END

# Header
! open(OFH,">H3T6.1DATA10.csv");
! print OFH "Time s,";
! print OFH "Wave Height @ 150m, ";
#================================================= ==================
! $numStart = 5;
! $numEnd = 20;
! for (my $i=$numStart; $i<=$numEnd; $i=$i+5) {
> load timestep = $i
> load
! $jjpt1 = getExprVal('WaveHeight');
# Print the lines
! print OFH "$jjpt1, ";
# repeat around loop
! }
!close(OFH);
# ================================================== =================
# end

Cluain October 8, 2012 07:26

Is this possible?

ghorrocks October 8, 2012 07:57

How about load the file in Excel, Copy/Paste special/Transpose and save it again? If you need to script it then a simple perl/python/batch/anything script can do it.

Also try the "\n" string to signify new line in the perl script.


All times are GMT -4. The time now is 16:33.