I have a file which has about 10000 records and I need to delete about 50 records from the file. I know line numbers and am using
sed '134,1357,......d' filename > new file
.
It does not seem to be working.
Please Advice
I have a file which has about 10000 records and I need to delete about 50 records from the file. I know line numbers and am using
sed '134,1357,......d' filename > new file
.
It does not seem to be working.
Please Advice
sed '134d;1357d;......d' filename > new file
code:-
sed '134,1357 {
d
}
' file.txt > out_file
write the code as above literally...where the begin line#=134 & end line#=1357 or you can change them to what ever you want.
That is a range of more than the 50 lines the OP mentioned. I got the impression he meant 50 distinct single lines of which he knows the line numbers
ok my code is to delete the line between ranges..I have understand that but if the lines are not after each other the only way is you way..
BR
Thanks SCRUTINIZER works perfect.