Is there a way to extract/copy the fist X number of lines from a file and input them into another file with a single command using the windows command prompt?
I can delete the first X number of lines using:
more +X [file_containing data] > [file_to_export_data_to]
If the head command would work I think I could just do this:
head -X [file_containing data] > [file_to_export_data_to]
But that unfortunately does not work.
It would be great if Windows had a "less" command but again no luck.
I'm a complete novice when it comes to this stuff so I'm sure I'm missing something obvious. I don't want to install anything or use something other than the command prompt.
Thanks
Press the "Enter" key. - Type "unzip [file_location]\[filename. zip]" into the command prompt, replacing "[file_location]" with the full directory path and "[filename. zip]" with the name of the ZIP file you want to extract.
the simplest one-command solution is to use Powershell Get-Content.
N - number of lines.
From the begining of file:
Get-Content -Head N file.txt
From the end of file:
Get-Content -Tail N file.txt
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