![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | RE: How to convert Table-Format Data to CSV-Format? Prevous version needed fine tuning --did it in a hurry. Now it split lines even when the value part is null and removes the dash from property names. $out = @() switch -r -f <AV log's path> { '^Da' { $obj = new-object psObject } '^\w' { $prop, $val = [regex]::split($_,' ?=\s|$)')$prop = $prop -replace '\s|-' if ($val) {$val = $val.trim()} add-member 8 $prop $val -in $obj } '^-+$' { $out += $obj rv obj } } if ($obj) { $out += $obj rv obj } $out | epcsv out.csv -not ipcsv out.csv -- Kiron |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| -f format Format-Table Format-List against Select | PowerShell | |||
| RE: How to convert Table-Format Data to CSV-Format? | PowerShell | |||
| RE: How to convert Table-Format Data to CSV-Format? | PowerShell | |||
| Format-table | PowerShell | |||
| How do I get format-table to drop that omission points (...) and display my data | PowerShell | |||