Using Matches in powershell

Multi tool use
Multi tool use
The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP


Using Matches in powershell



I am fairly new with powershell and would like some assistance. I am pulling file locations from a CSV file, searching those files for links. Capturing the links and would like to export to a new CSV file with the matches in one column and the file they were found in another.



I am having trouble arranging my results. Any help would be appreciated.



Here is what I have so far.


$csv = Import-csv "C:Usersn609078Desktoptesting_aaronfind_test.csv"

$csv | ForEach-Object {

$path = $_.path

Select-String $path -pattern '<a href="(.*?)".*?>.*?</a>' -AllMatches |
ForEach-Object {$_.Matches.Groups[1].Value}

}





Welcome as a new user to SO. Please take the tour and also read How to Ask. What is the content/headers of c:find_test.csv? If it's a proper csv file use Import-csv to read it into a variable.
– LotPings
yesterday


c:find_test.csv


Import-csv





Thanks ,my csv doesn't have headers. It's just one column consisting of different file locations to html files that I would like to search for links.
– A-A-Ron
yesterday







Not really a csv then..
– TheIncorrigible1
yesterday





Possible duplicate of Windows PowerShell parse HTML local file
– LotPings
yesterday





I have revised my code and added a header "path" to my csv. I'm pulling the links but still not sure how to export to new CSV. Update in original code above
– A-A-Ron
yesterday











By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

O,6a8a8InZupcKL,8FW,yz eV5Qm1D
8VE,bcIxyF1kZ09FuBPmbc

Popular posts from this blog

Keycloak server returning user_not_found error when user is already imported with LDAP

PHP parse/syntax errors; and how to solve them?

415 Unsupported Media Type while sending json file over REST Template