Search Results

Search: Posts Made By: gleu
14,998
Posted By gleu
What is the output from this command: awk...
What is the output from this command:

awk '!/initials: 1/' ORS="\n\n" RS= data|fgrep initial

nothing at all (after replacing data with myfile).
hmm...looks like my gawk (and awk) is broken on...
14,998
Posted By gleu
gawk '!/initials: 1/' ORS="\n\n" RS= myfile ...
gawk '!/initials: 1/' ORS="\n\n" RS= myfile

Here's a sample of myfile where the second block should be deleted because of the pattern - initials: 1
dn: cn=LMP0330,ou=People,o=myOrg...
14,998
Posted By gleu
I can't get your version (nor ghostdog74) to...
I can't get your version (nor ghostdog74) to output anything.
gawk '!/pattern/' ORS="\n\n" RS= myfile
Strange
... but at least the sed version works a treat!
14,998
Posted By gleu
The awk code looks straightforward but I could...
The awk code looks straightforward but I could not get that code to work
gawk 'BEGIN {RS=""}/pattern/{next}' myfile
(I took out the 1 after next because I thought it was a typo... but in any case...
14,998
Posted By gleu
Thanks. I've also been reading the relevant...
Thanks.
I've also been reading the relevant bits in Sed & Awk by Dale Dougherty and Arnold Robbins (O'Reilly). I understand the code now.
14,998
Posted By gleu
Yes. Thank you, Radoulov. You interpreted my...
Yes. Thank you, Radoulov. You interpreted my question correctly. (Sorry, Franklin52 that it was none too clear).

I don't quite understand the above bit of code about the Set-Aside buffer (but I'll...
14,998
Posted By gleu
Delete a block of text delimited by blank lines when pattern is found
I have a file which contains blocks of text - each block is a multi-lines text delimited by blank lines eg.

<blank line>
several lines of text
...
pattern found on this line
several more lines...
Showing results 1 to 7 of 7

 
All times are GMT -4. The time now is 10:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy