Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!quiche!storm From: storm@cs.mcgill.ca (Marc WANDSCHNEIDER) Newsgroups: comp.lang.pascal Subject: Selective write within files Summary: How to do this? Message-ID: <1991Mar27.160905.1962@cs.mcgill.ca> Date: 27 Mar 91 16:09:05 GMT Sender: news@cs.mcgill.ca (Netnews Administrator) Organization: SOCS, McGill University, Montreal, Canada Lines: 29 Say I have the following file (assigned to TEST.TXT): --> This is a nice little file that has a few lines of straight ASCII text that I wish to manipulate. After I've written this program, I will then print it out, and give a copy to my friend --> My Question: Is there any way to just selectively take this text file, delete and then rewrite the file to a different name WITHOUT loading the ENTIRE file into memory and REWRITING the whole thing....? Ie, I need to search in the text file for somthing (even though I ALWAYs know where the thing I am looking for is), then remove that word, replace it with another, and then rewrite the file. Can I do it, or do I have to load the entire file into memory and then work with string handlers from there before rewriting. ./*- -- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ storm@cs.mcgill.ca McGill University It's 11pm, do YOU Marc Wandschneider Montreal, CANADA know what time it is? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~