I am not looking for 4 different strings, each on it's own line. Grep -e, or egrep, would work fine for this.
I am searching for these 4 lines, together, when they appear back to back.
In order for the condition to be true, all 4 lines must exist, exactly as seen below.
In the pattern match, I need to search for something like this:
I also tried:
I also thought about using "tr" to delete the matching strings, but I'm still having an issue matching the 4 lines, to include their special characters. i.e. Line Feeds or Carriage Returns.
Unfortunately, either I'm using the wrong carriage return characters, or something is wrong with my systax.
Basically, each time the above 4 lines occur, back to back, on separate lines, I need to remove all 4 lines.
There will be times when the 4 lines will appear, where they have some other entries in the middle, such as:
Note that if there are ANY characters or data of any kind between, or in the middle of the 4 line pattern, those are valid data lines, and must not be removed.
Only when the 4 lines appear, back to back, with NOTHING else between them, or appended to them, do they need to be removed.
I hope this helps to clarify the issue.
JCF
Moderator's Comments:
Use code tags, thanks.
Last edited by zaxxon; 09-28-2015 at 11:04 AM..
Reason: code tags
Hi all,
I've been working on a script which I have hit a road block now. I have written a script using sed to extract the below data and pumped into another file:
Severity............: MAJORWARNING
Summary:
System temperature is out of normal range.
Severity............: MAJORWARNING... (13 Replies)
I have several huge files wich contains oracle table creation scripts as follows:
I would need to remove the pattern colored in red above. Any sed/awk/pearl code will be of much help.
Thanks (2 Replies)
Hi,
I'm trying to remove multiple lines of text based off a series of different words and output it to a new file
The document contains a ton of data but i want to delete any line that has the following
mx1.rr.biz.com or ns2.ri.biz.com
i tried using grep -v filename "mx1.rr.biz.com" >... (3 Replies)
Hello People,
Need some assistance/guidance.
OUTLINE:
Two files (File1 and File2)
File1 has some ids such as
009463_3922_1827
897654_8764_5432
File2 has things along the lines of:
Query= 009463_3922_1827 length=252
(252 letters)
More stufff here
... (5 Replies)
I have sql file containing lot of queries on different database table. I have to filter specific table queries.
Let say i need all queries of test1,test2,test3 along with four lines above it and sql queries can be multi lines or in single line.
Input file contains.
set INSERT_ID=1;
set... (1 Reply)
I have a file that has some lines starts with *
I want to get these lines, then get the word between "diac" and "lex".
ex.
file:
;;WORD AlAx
*0.942490 diac:Al>ax lex:>ax_1 bw:Al/DET+>ax/NOUN+ gloss:brother pos:noun prc3:0 prc2:0 prc1:0 prc0:Al_det per:na asp:na vox:na mod:na gen:m num:s... (4 Replies)
Hello Experts , require help . See below output:
File inputs
------------------------------------------
Server Host = mike
id rl images allocated last updated density
vimages expiration last read <------- STATUS ------->... (4 Replies)
Not sure how I can accomplish this. I would like to remove all interfaces that have the commands I would like to see: switchport port-security, spanning-tree portfast. One line is no problem.
interface FastEthernet0/8
spanning-tree portfast
interface FastEthernet0/9
spanning-tree... (4 Replies)
Hello Gurus,
I have a multiple pipe separated files which have records going over multiple Lines. End of line separator is \n and records going over multiple lines have <CR> as separator. below is example from one file.
1|ABC DEF|100|10
2|PQ
RS
T|200|20
3| UVWXYZ|300|30
4| GHIJKL|400|40... (7 Replies)