|
-
May 27th, 1999, 11:38 AM
#1
How to modify a file's content?
I want to change a file's content,such as ,I want to delete or modify a random line of a file.
How to do this?
-
May 27th, 1999, 01:49 PM
#2
Re: How to modify a file's content?
You can open a second file read from the first and write to the second. In the process you can make your modifications. For example skipping a line etc. When done close second file(with a temporary name), delete the origianl and rename the temp file to the original name. A bit safer than reading the file into memory truncating the file to zero length and writing from memory to file.
Hope this helps
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|