Script to find count of a string in a .cvs file - Powershell

I need to write a script to scan a group of .csv files and return a total of lines a specific string occurs on.

Preferably Powershell.
Who is Participating?
wmehardtConnect With a Mentor Commented:
(gci *.csv | select-string "<string here>" | measure-object).count
someITGuyAuthor Commented:
Are the brackets ( )  in the correct place?
wmehardtConnect With a Mentor Commented:
Yup, are you having issues? What is the string you are looking to match? You can also do it this way with no parentheses

Select-String -path c:\folder\*.csv -pattern "string" | measure-object | select count
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.