[Solved] Parse string in Powershell and create a table


I have to admit this is a bit excesive use of .replace() but there isn’t much to work with:

$mystring= "    S: Title = test S: Title = test2 S: Title = test3 S: Title = test4 
 TE: 2019-01-19T00:00:00Z TE: 2019-01-20T00:00:00Z TE: 2019-01-22T00:00:00Z TE: 2019-01-23T00:00:00Z "


$MyString.trim().replace(" S: Title = ",",").replace("T00:00:00Z TE: ",",").replace("TE: ","").replace("S: Title = ","").replace("T00:00:00Z","").replace(" ","") | convertfrom-csv

Output:

test         test2        test3        test4     
----         -----        -----        -----     
2019-01-19   2019-01-20   2019-01-22   2019-01-23

It would be easyer (and more overseeable) to implement those steps in the creation of the string.

solved Parse string in Powershell and create a table