• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Processing File Contents

It’s not much harder to read and process a text file using JScript than it is to create and write to it. The first thing that you have to do is use the FileSystemObject object’s FileExists() method to perform a check to determine whether or not the file you want to read exists. If it does exist, your script can open and begin to read it. The next thing that your script will need to do is to make sure that the file contains some data to process. You can do this using the TextStream object’s AtEndOfStream property. In addition, the AtEndOfStream property will need to be checked just before each additional read operation to make sure that the end of the file has not been reached.

The following example demonstrates how to use JScript to read and process the output file created by the previous script:


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint