CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

Opening a file from previous time folder and add new lines

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By HakikiCanakkaleli

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   July 3, 2014, 16:47
Default Opening a file from previous time folder and add new lines
  #1
ooo
Member
 
Join Date: Feb 2012
Posts: 49
Rep Power: 14
ooo is on a distinguished road
Dear FOAMers,

Using the code below, one can create a file in each time folder and write some data into a file
Code:
OFstream test (runTime.timeName()/"test.csv");
test << " " << endl;
But i want to open the already written file from the previous time folder, and then add new lines to the file(without overwriting that).
I would appreciate any idea.
ooo is offline   Reply With Quote

Old   July 6, 2014, 17:45
Default
  #2
Senior Member
 
Canakkale Dardanelspor
Join Date: Aug 2012
Posts: 135
Rep Power: 13
HakikiCanakkaleli is on a distinguished road
Utilise 'append' functionality of C++.
http://stackoverflow.com/questions/2...text-file-in-c
ooo likes this.
HakikiCanakkaleli is offline   Reply With Quote

Old   July 6, 2014, 18:35
Default
  #3
ooo
Member
 
Join Date: Feb 2012
Posts: 49
Rep Power: 14
ooo is on a distinguished road
Quote:
Originally Posted by HakikiCanakkaleli View Post
Utilise 'append' functionality of C++.
http://stackoverflow.com/questions/2...text-file-in-c
Thanks, but the problem is that, first we should copy the file from the previous time folder to the current time folder(or create a file and copy the content of the file in the previous time folder), and then append the new text ...
ooo is offline   Reply With Quote

Old   November 22, 2014, 11:31
Default
  #4
ooo
Member
 
Join Date: Feb 2012
Posts: 49
Rep Power: 14
ooo is on a distinguished road
Sorry, the suggestion of HakikiCanakkaleli works, by using the functionality of c++.
Thanks

Last edited by ooo; November 22, 2014 at 16:49.
ooo is offline   Reply With Quote

Reply


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
[openSmoke] libOpenSMOKE Tobi OpenFOAM Community Contributions 562 January 25, 2023 09:21
[PyFoam] and paraview eelcovv OpenFOAM Community Contributions 28 May 30, 2016 09:23
plot over time fferroni OpenFOAM Post-Processing 7 June 8, 2012 07:56


All times are GMT -4. The time now is 13:01.