Timeline for Print everything between two patterns, then delete first and last line of the resulting output [duplicate]
Current License: CC BY-SA 3.0
18 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| Mar 15, 2018 at 0:50 | history | closed | don_crissti Kiwy elbarna Timothy Martin G-Man Says 'Reinstate Monica' | Duplicate of Print lines between (and excluding) two patterns | |
| Mar 14, 2018 at 12:00 | review | Close votes | |||
| Mar 15, 2018 at 0:50 | |||||
| Jun 18, 2015 at 11:32 | answer | added | Scott - Слава Україні | timeline score: 1 | |
| Jun 18, 2015 at 9:54 | comment | added | Stéphane Chazelas | That FAQ is about generally operating on a range exluding the boundaries, in that example they prepend >> to each line, but of course, you can use -n and print them instead or whatever operation you want to perform on the range. | |
| Jun 18, 2015 at 9:46 | vote | accept | syntaxerror | ||
| Jun 18, 2015 at 9:29 | comment | added | syntaxerror | @StéphaneChazelas Thanks for that FAQ site, but -- that addresses a different problem, at least telling from the output (Contents of input.fil - Output of sed script). It will also print the lines preceding first pattern and following second pattern. Hence, that's not entirely the same... | |
| Jun 18, 2015 at 9:22 | comment | added | Stéphane Chazelas | Thats sed FAQ 4.24 | |
| Jun 18, 2015 at 8:52 | comment | added | syntaxerror | @Cyrus Oops!! Good catch. Totally forgot to specify my output... | |
| Jun 18, 2015 at 8:51 | history | edited | syntaxerror | CC BY-SA 3.0 | added 81 characters in body |
| Jun 18, 2015 at 8:47 | comment | added | syntaxerror | @G-Man "Resulting output" refers to the output between the two pattern matches A and B (both of which I want to exclude). And from plain logic, what you get out will always have pattern A as first line and pattern B as the last, so a simple sed statement that does a d on first and last line will do. | |
| Jun 18, 2015 at 5:44 | comment | added | G-Man Says 'Reinstate Monica' | Seriously. Define "between". Define "print, then delete". What do you mean, "... the resulting output will always contain the two patterns on first and last line ..."? Do you want start_data and end_data in your output or don't you? | |
| Jun 18, 2015 at 4:52 | answer | added | mikeserv | timeline score: 3 | |
| Jun 18, 2015 at 4:37 | answer | added | jimmij | timeline score: 4 | |
| Jun 18, 2015 at 3:15 | comment | added | Cyrus | Show desired output for that sample input. | |
| Jun 18, 2015 at 1:46 | answer | added | kos | timeline score: 1 | |
| Jun 18, 2015 at 0:55 | history | edited | syntaxerror | CC BY-SA 3.0 | edited title |
| Jun 18, 2015 at 0:49 | answer | added | John1024 | timeline score: 3 | |
| Jun 18, 2015 at 0:31 | history | asked | syntaxerror | CC BY-SA 3.0 |