Linked Questions

-2 votes
1 answer
661 views

I have n files, like: file1: Hannah Lars Test 123 1aaa 2eee file2: Mike Charly Stephanie Earl Test 123 3ccc 4ddd 5eee I want to remove all rows after "Test 123" from all n files. The ...
Dr-Bracket's user avatar
  • 5,704
116 votes
8 answers
105k views

I have a file something like: # ID 1 blah blah blah blah $ description 1 blah blah # ID 2 blah $ description 2 blah blah blah blah How can I use a sed command to delete all lines between the # and $ ...
Ken's user avatar
  • 4,193
4 votes
3 answers
7k views

I am trying to filter an *.ics file using sed. The *.ics file looks like this: [...] BEGIN:VEVENT UID:0xfoo SUMMARY:foo DTSTART:20131212T090000 DTEND:20131212T100000 SEQUENCE:0 DTSTAMP:...
edloaa's user avatar
  • 117
2 votes
3 answers
5k views

my input file looks like this: [1234] text text text [3456] text text text [7458] text text text I want to delete all lines between the patterns, including FROM_HERE and excluding TO_HERE. sed '...
calabash's user avatar
  • 115
2 votes
1 answer
5k views

So I've found a great deal on deleting the text between two patterns and on printing the text between two delimiters but I haven't found anything on printing the text between two patterns using bash ...
Ocasta Eshu's user avatar
2 votes
5 answers
3k views

I am trying to replace lines between two pattern/string matches using SED see below. I need to delete lines below interface GigabitEthernet0/3 up to interface GigabitEthernet0/4, but leaving both ...
Brian Tillman's user avatar
3 votes
3 answers
1k views

I have been working on some simple bash script recently, which parses specific data from webpages. I have used tr '\r\n' ' ' <file1.txt >file2.txt to make sure, all extracted data from page is ...
UncleSam's user avatar
0 votes
2 answers
669 views

I saw and read many topics about my problem, but they didn't help me. a close topic to my problem but it didn't help me: removing lines between two patterns (not inclusive) with sed Question: I have ...
ali reza's user avatar
  • 151
0 votes
1 answer
174 views

I have a text file containing some recurrent patterns, and I want to remove the lines between each matching pair of matching pattern. Problem: The last occurrence of "pattern line" is the "opening ...
glaugier's user avatar
-1 votes
3 answers
79 views

I'm trying to remove some JavaScript between two patterns. The patterns are: /* React App Start */ And /* React App End */ I can successfully remove the JavaScript with the following: sed -i -e '/\/\...
Rob H's user avatar
  • 46