CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Post-Processing

Text editor for huge reconstructed files

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   March 16, 2017, 09:33
Default Text editor for huge reconstructed files
  #1
New Member
 
Michael Hoss
Join Date: Sep 2016
Posts: 8
Rep Power: 8
Knusper is on a distinguished road
Dear Foamers,

I came across the problem of huge reconstructed files, which were several GB is size for example for U. Neither nedit nor gedit could efficiently display these files. Also modifying and saving takes a lot of time with the standard text editors and sometimes they completely fail.

Therefore, I want to share two bash scripts with you that I developed in order to deal with huge files:

findAndDisplay.bsh writes all occurrences of a search string into a small file, where also a certain environment of maybe +-10 lines is included. An example of such a small file is given in exampleOutput.txt. This file can then easily be modified with a standard text editor.

reinsert.bsh takes such a modified smaller file as an argument and inserts the changes back to the large original file.

Usage:
  • Rename both scripts from .txt to .bsh
  • Adjust the ## inputs ## section at the beginning of both scripts to your needs (paths, file names, string to be searched). Both scripts work with absolute paths.
  • chmod 755 both scripts
  • ./findAndDisplay.bsh
  • Open the small output file and edit it depending on your needs. Important: Edit only the part in between "--- Beginning of a section --- Line xxx" and "--- End of a section --- Line yyy". Do NOT edit line numbers xxx or yyy. However, lines can be added or deleted.
  • ./reinsert.bsh


I have tested the functionality of both scripts various times and all known bugs have been fixed. However, no guarantee is given. I hope this will help somebody else and other users dealing with huge files will not have to write such scripts on their own. In case of open questions, feel free to ask in this thread.
Attached Files
File Type: txt findAndDisplay.txt (4.3 KB, 6 views)
File Type: txt reinsert.txt (4.9 KB, 1 views)
File Type: txt exampleOutput.txt (5.2 KB, 3 views)
Knusper is offline   Reply With Quote

Reply

Tags
editor, huge file, nedit, script, text file

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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
OpenFOAM15 paraFoam bug koen OpenFOAM Bugs 19 June 30, 2009 11:46
Converting ANSYS CFX files to Fluent files Martin S. Rasmussen FLUENT 3 January 30, 2007 16:08
Results saving in CFD hawk Main CFD Forum 16 July 21, 2005 21:51
Automatic moving of files Jörn Beilke Siemens 0 November 7, 2004 15:11
200 data files to post process (how?) Mark R FLUENT 1 August 9, 2001 14:35


All times are GMT -4. The time now is 17:36.