|
[Sponsors] |
October 2, 2012, 13:39 |
CCL code Row to Column
|
#1 |
Member
Join Date: Oct 2011
Posts: 32
Rep Power: 15 |
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 |
|
October 8, 2012, 08:26 |
|
#2 |
Member
Join Date: Oct 2011
Posts: 32
Rep Power: 15 |
Is this possible?
|
|
October 8, 2012, 08:57 |
|
#3 |
Super Moderator
Glenn Horrocks
Join Date: Mar 2009
Location: Sydney, Australia
Posts: 17,870
Rep Power: 144 |
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. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
The FOAM Documentation Project - SHUT-DOWN | holger_marschall | OpenFOAM | 242 | March 7, 2013 13:30 |
How to make code run in parallel? | cwang5 | OpenFOAM Programming & Development | 1 | May 30, 2011 05:47 |
Open Source Vs Commercial Software | MechE | OpenFOAM | 28 | May 16, 2011 12:02 |
Small 3-D code | Zdravko Stojanovic | Main CFD Forum | 2 | July 19, 2010 11:11 |
Adding Custom Tab in FLUENT using Scheme Code | dhimans | Fluent UDF and Scheme Programming | 0 | September 14, 2009 16:10 |