I have a large file with thousands of simple div tags, which I need to index somehow, best by counting up <div n="00001">...<div n="00002">.......<div n="32002">.
So, my question is how to get an array into the basic replace command:
(Get-Content c:\Texts\mytext.txt).replace('<div>', '<div n="$a">') | Set-Content c:\Texts\mytextneu.txt
It would be even better if the resulting id always has 5 digits, as in the example above.
<div>tag on a single line?