Reading, Writing and Editing Files
Keywords: writing to files filewrite fileappend
Reading and Writing to Files:
Is there a way to open a file, and read and write to it during the same session? Do files only allow one or the other to occur without closing and reopening?
Files can be opened and then either read or written. You cannot do both in the same file open session. Here are some ways to read, write, and append files.
Do one of the following:
- Open two files, copying and modifying data from one and then writing to the other. Then rename the new file when done, and then save it.
- Copy data to a temporary file, and use the FileAppend function to glue two files together.
Editing:
An alternative to reading a file and rewriting to another file line by line is to use Notepad, or some other editor. Load your file into Notepad, Word, Write, or another editor, and use Sendkeysto to alter it.
Also see BinaryCopy commands or FileCopy commands
Article ID: W12999Filename: Reading Writing and Editing Files.txt