Razvan
Razvan

Reputation: 10093

Linux line oriented text file manipulation

I have a large text file (1,2,3 GB) organized as a sequence of lines, as follows:

   __________________________
   __________________________
   __________________________
             ...
   __________________________

What is the simplest way (command, bash script) to copy a portion of this file into a new file(e.g: copy everything from line 10 to line 1000) ? The line interval should be passed as a parameter.

Upvotes: 0

Views: 313

Answers (1)

Ignacio Vazquez-Abrams
Ignacio Vazquez-Abrams

Reputation: 799150

sed -n 10,1000p input.txt > output.txt

Upvotes: 4

Related Questions