I have csv file and want to output a new csv file, that only contains the first 10 lines form the original one. I've so far only found code to delete single lines or lines that contain a certain word. Its probably a 15 character one-liner, but I am not sure how to approach this, any help would be greatly appreciated. I don't expect you to write code, just the right command would help me out.
In PowerShell to select first 10 lines of file, use Get-Content command with Select -First parameter with value 10.
Get-Content "C:\start.csv" | select -First 10 | Out-File "C:\stop.csv"
That did it
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With