Parse Text Data

Find, Replace, and Extract Text you own this product

This project is part of the liveProject series Parse Text Data with PowerShell
prerequisites
intermediate PowerShell (use variables, common PowerShell built-in cmdlets, loop statements)
skills learned
read text and import objects from a CSV file • write to a text file • basic regex • extract substrings from text • index arrays using expressions • create custom objects • export output to CSV and HTML formats • change PowerShell's default HTML output format
Fernando Corrales
1 week · 6-8 hours per week · INTERMEDIATE

pro $24.99 per month

  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose one free eBook per month to keep
  • exclusive 50% discount on all purchases

lite $19.99 per month

  • access to all Manning books, including MEAPs!

team

5, 10 or 20 seats+ for your team - learn more


Look inside

XYZ Services Company, a consulting and outsourcing firm, recently experienced a massive failure in its IT infrastructure. While it’s working on getting the environment up and running again, the marketing director wants to email partners a report that includes contact information for all the marketing staff. As a PowerShell developer, your task is to write a PowerShell script that extracts properties from the plain-text employee directory file, uses those properties to build a custom PowerShell object, and exports the object to a CSV file which you’ll use to generate an HTML report that’s formatted for the marketing director’s purpose. As a favor to the HR department, you’ll also write a PowerShell script that corrects values in a specific field within the source file and writes the edited content to a new file.

This project is designed for learning purposes and is not a complete, production-ready application or solution.

book resources

When you start your liveProject, you get full access to the following books for 90 days.

project author

Fernando Corrales
Fernando Corrales is a cloud engineer with several years of IT experience in multinational companies. He’s worked extensively with VMware products, focusing on private cloud automation with PowerCLI and PowerShell, in addition to delivering PowerShell training for some of his recent employers. Fernando holds several technical degrees from the Tecnológico de Costa Rica and has a personal blog: fercorrales.com.

prerequisites

This liveProject is for technology administrators and intermediate-level PowerShell users who want to learn or expand their text and string parsing skills. To begin these liveProjects, you’ll need to be familiar with the following:

TOOLS
  • Intermediate PowerShell 7
  • Visual Studio Code with PowerShell extension
  • MS Excel or any CSV viewer
  • An HTML editor

you will learn

In this liveProject, you’ll learn to parse text with PowerShell, convert strings into PowerShell objects, use those objects to create an HTML report, modify content from a text file, and write it to an output file.

  • Use the Select-String cmdlet to find text that matches the desired pattern
  • Work with advanced regex expressions, including lookbehind
  • Use loops and conditional statements to sequentially process objects from a collection
  • Build a custom PowerShell object
  • Export objects to CSV format
  • Use the ConvertTo-Html cmdlet to build an HTML table from PowerShell objects
  • Use the replace operator to modify text strings
  • Use Get-Content, Set-Content, and Out-File cmdlets
  • Read and write text to a file using PowerShell

features

Self-paced
You choose the schedule and decide how much time to invest as you build your project.
Project roadmap
Each project is divided into several achievable steps.
Get Help
While within the liveProject platform, get help from other participants and our expert mentors.
Compare with others
For each step, compare your deliverable to the solutions by the author and other participants.
book resources
Get full access to select books for 90 days. Permanent access to excerpts from Manning products are also included, as well as references to other resources.

choose your plan

team

monthly
annual
$49.99
$499.99
only $41.67 per month
  • five seats for your team
  • access to all Manning books, MEAPs, liveVideos, liveProjects, and audiobooks!
  • choose another free product every time you renew
  • choose twelve free products per year
  • exclusive 50% discount on all purchases
  • Find, Replace, and Extract Text project for free