Ever had a bunch of rows in a text file that you would like to format as an html table, but don’t want to take as much time formatting all of the tr and td rows. You can do something like this:
Say you have a comma-delimited text file with some rows like:
1 |
foo1,foo2,foo3 |
And you want to output them as html or something, you can do something like this:
1 2 |
Get-Content .\thetext.txt | %{ $data = $_.split(","); Write-Output " $($data[0]) $($data[1]) $($data[2])" } > text-output.html |
You should get something like this:
1 |
foo1 foo2 foo3 |
It certainly speeds up some tedious formatting of some static or maybe dynamic data.