Delete specific Range of lines Using sed , awk, grep etc.
hi,
My issue is that I want to delete a range of lines from a txt file Using shell scripting.For example in a file containing 100 lines, I want to delete only specific lines in the range of 11 to 29 .I can use any command for this purpose in shell script. Somebody please suggest a solution line no. 10 contains 10 <Help 11 Name ="Maintenance Department" 12 Help=""> 13 >Text 14 ............... 15 <F1 16 ........... 17 ......... 18 19 <text 20 ......... 21 ........... 22 <F1> 23 ........... 24 ......... 25 <text 26 ......... 27 ........... 28 </Help> 29 <Help 30 Name ="Clearing Department" 31 Help=""> 32 >Text 33 ............... 34 <F1 35 ........... 36 ......... Is there anyone who can help me out |
If you mentioned WHICH lines in that range you'd like
to remove, maybe? Cheers, Tink |
Sounds like homework to me Tink ...
|
The command to be used was
sed '2,10d' a.org > b.txt this would delete line ranging from 2 to 10 including them. It looks so easy. but it came after a lot of research |
Quote:
eg: sed '/text/,/F1/d oldfile > newfile |
All times are GMT -5. The time now is 03:20 AM. |