jeffharbert

Randomize lines in CSV file wiht Powershell

Jul 12th, 2021
1,755
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Change the Import-CSV and Export-CSV file paths as needed
  2. $InputList = Import-CSV "C:\path\to\csv file\filename.csv"
  3. $InputList = $InputList | Sort-Object {Get-Random} | Export-CSV "C:\path\to\csv file\filename_randomized.csv"
Advertisement
Add Comment
Please, Sign In to add comment