I want to extract a few thousands lines from a giant CSV file (~15GB, 6 million lines) from line number X to line number Y, without using a lot of RAM.
Using Powershell 2.0 from the command line interpreter, I was able to extract the first 2000 lines with:
PS> Get-Content -TotalCount 2000 file.csv > first_lines.csv
,
and the last 2000 lines (skipping the first 5,998,000 ones), from the cmd.exe interpreter itself, with:
more +5998000 file.csv > last_lines.csv
,
but now I want to extract, say, from line 3,000,001 to line 3,002,000, without having to create huge new files or put too much pressure on RAM.
Thanks in advance!