Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

A related question is herehere.

I often have to edit a large file by removing a few lines from the middle of it. I know which lines I wish to remove and I typically do the following:

sed "linenum1,linenum2 d" input.txt > input.temp

or in-line by adding the -i option. Since I know the line numbers, is there a command to avoid stream-editing and just remove the particular lines? input.txt can be as large as 50 GB.

A related question is here.

I often have to edit a large file by removing a few lines from the middle of it. I know which lines I wish to remove and I typically do the following:

sed "linenum1,linenum2 d" input.txt > input.temp

or in-line by adding the -i option. Since I know the line numbers, is there a command to avoid stream-editing and just remove the particular lines? input.txt can be as large as 50 GB.

A related question is here.

I often have to edit a large file by removing a few lines from the middle of it. I know which lines I wish to remove and I typically do the following:

sed "linenum1,linenum2 d" input.txt > input.temp

or in-line by adding the -i option. Since I know the line numbers, is there a command to avoid stream-editing and just remove the particular lines? input.txt can be as large as 50 GB.

added a related question
Source Link
LasEspuelas
  • 203
  • 1
  • 2
  • 7

A related question is here.

I often have to edit a large file by removing a few lines from the middle of it. I know which lines I wish to remove and I typically do the following:

sed "linenum1,linenum2 d" input.txt > input.temp

or in-line by adding the -i option. Since I know the line numbers, is there a command to avoid stream-editing and just remove the particular lines? input.txt can be as large as 50 GB.

I often have to edit a large file by removing a few lines from the middle of it. I know which lines I wish to remove and I typically do the following:

sed "linenum1,linenum2 d" input.txt > input.temp

or in-line by adding the -i option. Since I know the line numbers, is there a command to avoid stream-editing and just remove the particular lines? input.txt can be as large as 50 GB.

A related question is here.

I often have to edit a large file by removing a few lines from the middle of it. I know which lines I wish to remove and I typically do the following:

sed "linenum1,linenum2 d" input.txt > input.temp

or in-line by adding the -i option. Since I know the line numbers, is there a command to avoid stream-editing and just remove the particular lines? input.txt can be as large as 50 GB.

Source Link
LasEspuelas
  • 203
  • 1
  • 2
  • 7

Is there a faster way to remove a line (given a line number) from a file?

I often have to edit a large file by removing a few lines from the middle of it. I know which lines I wish to remove and I typically do the following:

sed "linenum1,linenum2 d" input.txt > input.temp

or in-line by adding the -i option. Since I know the line numbers, is there a command to avoid stream-editing and just remove the particular lines? input.txt can be as large as 50 GB.