Chapter 16. Working with files, text, and XML

 

This chapter covers:

  • 16.1 PowerShell and paths
  • 16.2 File processing
  • 16.3 Processing unstructured text
  • 16.4 XML structured text processing
  • 16.5 Summary

Where is human nature so weak as in the bookstore?

Henry Ward Beecher

Outside of a dog, a book is man’s best friend. Inside of a dog, it’s too dark to read.

Groucho Marx

In this chapter, we’re going to cover PowerShell’s features for processing text and files. We’ll look at how PowerShell deals with file paths and concepts behind the provider model. We’ll revisit regular expressions and take another look at the language features and cmdlets that are provided for dealing with text. This chapter also covers the features that PowerShell offers for dealing with a special kind of text—XML—as strings and in files. In the process, you’ll see how to use the .NET classes to accomplish tasks when the native PowerShell language features may not be sufficient.

16.1. PowerShell and Paths

16.2. File Processing

16.3. Processing Unstructured Text

16.4. Xml Structured Text Processing

16.5. Summary