Quantcast
Channel: /r/powershell – How to Code .NET
Viewing all articles
Browse latest Browse all 8793

How to increase performance of Import/export csv cmdlet

$
0
0

Hey,

How could i increase the performance of this?

$ csv = & {Import-Csv PATH1 | Where-object {$_.Component -eq "OpenBB"}| Select -Property *, @{n='Client';e={"Client1"}} Import-Csv PATH2 | Where-object {$_.Component -eq "OpenBB"} | Select -Property *, @{n='Client';e={"Client2"}} # .... etc 17 more times } } 

If statements in here, when i do a measure command the csv export takes 5mins roughly

 $csv| Export-csv "C:all-$(get-date -f yyyy-MM-dd ).csv" 

When exported this has around 100k rows, but takes around 10 mins to complete

submitted by /u/HugeName
[link] [comments]

The post How to increase performance of Import/export csv cmdlet appeared first on How to Code .NET.


Viewing all articles
Browse latest Browse all 8793

Latest Images

Trending Articles



Latest Images