![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| High Level Programming Post questions about C, C++, Java, SQL, and other programming languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| How to insert text in the middle of a file | kartikkumar84@g | UNIX for Dummies Questions & Answers | 6 | 05-10-2008 02:35 PM |
| insert text in the middle of a file | relle | Shell Programming and Scripting | 3 | 03-13-2008 03:37 PM |
| How to insert the 1st arg into the middle of the file | boris | Shell Programming and Scripting | 4 | 04-13-2007 12:21 AM |
| How to insert text into first line of the file and middle of the file? | ali hussain | Shell Programming and Scripting | 3 | 03-05-2007 05:54 AM |
| insert text into the middle of a original file | mopimp | Shell Programming and Scripting | 1 | 03-26-2006 10:11 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread |
Rating:
|
Display Modes |
|
|
|
||||
|
I have a problem that I want to insert and delete some chars in the middle of a file. fopen() and fdopen() just allow to append at the end.
Is there any simple method or existing library that allow these actions? Thanks in advance. ![]() |
|
||||
|
If you have the memory, you might want to read the whole file into memory, manipulate it there and then dump the results back to disk.
That could be faster depending on a number of factors e.g number of search operations, insert/delete operations, disk performance or size of file. |
|
||||
|
Quote:
|
|
||||
|
Quote:
My point to the OP was quite simple and old fashioned: memory is faster than disk! ( I hope that is still true these days )Peace ![]() |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|