I have this large csv (semicolon separated) file that I need to split into about 300 files based on the value in second column (file has header names).The file has about + 3 million rows and headers for 54 columns I have tried using this script with Powershell but it seems not to run. I can see in task manager that memory is building for a while but there is no output at all or error messages. I find this script here Splitting a xlsx/csv file based on column value and change the script to fit my needs. Have I missed something or what is wrong with this script as no output is executed...
What is missing?
$csv = Import-Csv C:\Data\Points\Se\Test\Data191017.csv -Delimiter ';'
$names = $csv | select -ExpandProperty OFFICENAME -Unique
foreach ($name in $names) { $csv | where {$_.name -like $name} | export-csv C:\Data\Points\Se\Test\20191028_$name.csv }