I have 265 CSV files with over 4 million total records (lines), and need to do a search and replace in all the CSV files. I have a snippet of my PowerShell code below that does
Actually, I'm faced with a similar issue right now. With my new job, i have to parse huge text files to pull information based on certain criteria. The powershell script (optimized to the brim) takes 4 hours to return a fully processed csv file. We wrote another python script that took just under 1 hour...
As much as i love powershell, i was heart broken. For your amusement, try this: Powershell:
$num = 0
$string = "Mary had a little lamb"
while($num -lt 1000000){
$string = $string.ToUpper()
$string = $string.ToLower()
Write-Host $string
$num++
}
Python:
num = 0
string = "Mary had a little lamb"
while num < 1000000:
string = string.lower()
string = string.upper()
print(string)
num+=1
and trigger the two jobs. You can even encapsulate in Measure-command{} to keep it "scientific".
Also, link, crazy read..