- Hear1 Header2 Header3
- aaa bbb ccc
- aaa bbb ccc
- 111 222 333
- 111 222 333
- Hear1 Header2 Header3
- aaa bbb ccc
- aaa bbb ccc
- Hear1 Header2 Header3
- 111 222 333
- 111 222 333
Creating mutiple tables from one
Forum rules
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Do not post any licensing information in this forum.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Creating mutiple tables from one
I have table that I want to make into separate tables. Basically I want to choose what's in a column in a table and make a new table with it. Please see the below.
Re: Creating mutiple tables from one
Sorry. Correct it is a csv. I want to keep the headers. But I want to separate it by what's in one of the columns
Re: Creating mutiple tables from one
I want to parse a CSV and then add it to different CSV's after the name of the Porcessname please see the code and part of the output. I can use Group-object to separate all the processes I just cant output each separately.
- Get-Process | Group-Object ProcessName|%{$_.Group | select ProcessName, ID | Format-Table}
- chrome.csv
- ProcessName Id
- chrome 2016
- chrome 5436
- chrome 5976
- chrome 7740
- chrome 9732
- chrome 9808
- MicrosoftEdgeCP.csv
- ProcessName Id
- MicrosoftEdgeCP 3364
- MicrosoftEdgeCP 7140
- MicrosoftEdgeCP 7856
- MicrosoftEdgeCP 8340
- MicrosoftEdgeCP 10372
Re: Creating mutiple tables from one
You could have figured this out. You were one step away.
- Get-Process |
- Group-Object ProcessName |
- ForEach-Object{
- $name = $_.Name
- $_.Group | Select-Object ProcessName, ID | Export-Csv $name.csv
- }