I've this type of data :
Name : Monday
Description : XXX
Type : Day 1
XXX : XXX
XXX : XXX
Name : Tuesday
Description : XXX
Type : Day 2
XXX : XXX
XXX : XXX
Name : Wednesday
Description : XXX
Type : Day 3
XXX : XXX
XXX : XXX
I'm able to keep only the Name and the Type :
$file = "D:\XXX\test.txt"
$data = Get-Content $file
foreach($i in $data){
$Name = $i | findstr /c:"Name"
$Type = $i | findstr /c:"Type"
Write-Output $Name
Write-Output $Type
}
The output is :
Name : Monday
Type : Day 1
Name : Tuesday
Type : Day 2
Name : Wednesday
Type : Day 3
But I would like this output :
Monday/Day 1
Tuesday/Day 2
Wednesday/Day 3
I know how to do that in bash but I'm totally lost with powershell...
Is there someone who can show me how to do that?