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

Chapter 4. File and Registry Access > Reading and Writing Files

Reading and Writing Files

It's often useful to be able to read and write text files in a script. Here are some ways you can use this ability:

  • Scripts often need to operate on a series of users, computers, files, or other targets. Rather than putting this information in the script itself, it may be better to keep the data separate from the script program, in a text file, where it can be edited without molesting the script itself. The script can read this file to get the list of items to work with.

  • Scripts can keep a log of their activities in a text file.

  • Scripts can operate on externally generated data files such as comma-delimited export files from a spreadsheet program.

  • Scripts can generate and place data into a text file for later printing, or they can import into a spreadsheet or database program.

  • A script can act as a filter, like the sort and more commands, reading the standard input and writing to the standard output.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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