Summary: Use Windows PowerShell to get a row from a CSV file based on a specific value.
Image may be NSFW.
Clik here to view. How can I use Windows PowerShell 4.0 to look up a specific row from a CSV file I imported into a variable?
Image may be NSFW.
Clik here to view. Use the Where method, and use a match pattern to search on a specific column and value, for example:
$topics = import-csv -Path C:\lit\Shakespeare.txt
$topics.Where({$PSItem.play -eq 'hamlet'}).topic
Image may be NSFW.
Clik here to view.
Clik here to view.
