176
General Software Discussion / Re: Extract REGEX matches from multiple text files
« on: August 10, 2018, 05:32 AM »Any idea why this does not work?
Get-Content *.xml | Out-String-kalos (August 09, 2018, 10:53 AM)
I have a better idea, you tell us why you think it doesn't work.gc *.xml -match *regex*
does not workCode: PowerShell [Select]
Get-Help Get-Content
You tell us why it doesn't work.-4wd (August 09, 2018, 07:59 PM)
Mmm I don't know why Get-Content *.xml | Out-String does not work to be honest.
I read at https://ss64.com/ps/out-string.html:
Send the content of Test1.txt to the console as a single string:
PS C:\> get-content C:\docs\test1.txt | out-string
So, shouldn't it work?
As for gc *.xml -match *regex* it seems that -match does not go after gc, but how do I connect/pipe these?
I had no clue, but I found in an irrelevant place on the internet this:
(Get-Content .\input.txt) -join "`r`n"
How should I know that I need to parenthesise the first object? Where does it say that in PS manual?