Hi All. I have html file and need to find row that contains string !dataset1! (easy part) and replace that row + next row with data stored in variable @mydata. I tried various things but it didn’t work.
!dataset1! is the only constant value I set in this html to find specific table.
To find a string in a text you could use Select-String. This would give you the line of text the string was found in. This you could use to replace it.
[quote quote=226915]To find a string in a text you could use Select-String. This would give you the line of text the string was found in. This you could use to replace it.
[/quote]
Tried without success in this case. Which code you would use?
Select-String -Path 'Complete Path To Your HTML File' -Pattern '!dataset1!' -SimpleMatch | Select-Object LineNumber
You should always read the complete help including the examples for the cmdlets you’re about to use to learn how to use them. And it helps usually to play a little bit with it and to try this and to try that.