Search Results

Search: Posts Made By: Litu19
2,052
Posted By Scrutinizer
Sure: Hi Litu, awk ' /Policy...
Sure:

Hi Litu,

awk '
/Policy Name/,/End of Policy/ { # from lines that contain "Policy Name" to lines that contain "End of Policy"
next # stop...
2,052
Posted By Yoda
awk '/Policy Name/{f=1;next}/End of...
awk '/Policy Name/{f=1;next}/End of Policy/{f=0;next}!f&&NF' filename
2,052
Posted By Scrutinizer
Try range expressions: awk '/Policy Name/,/End...
Try range expressions:
awk '/Policy Name/,/End of Policy/{next}NF' file

or, preserving the empty lines outside the range:
sed '/Policy Name/,/End of Policy/d' file
2,052
Posted By Kibou
I could help Scrutinizer trying to explain the...
I could help Scrutinizer trying to explain the example with sed.

sed '/Policy Name/,/End of Policy/d' file


To find text you put it between / /
So if you want to find some text you can do it...
2,058
Posted By Scrutinizer
I understand. How about: ...
I understand. How about:
PATTERN="^[[:blank:]]*\*\.debug[[:blank:]]*@vxhgt-hskhng02"
2,058
Posted By RudiC
small modification to PATTERN makes it...
small modification to PATTERN makes it work:PATTERN="*.debug[[:blank:]]*@vxhgt-hskhng02"
grep $PATTERN file
*.debug @vxhgt-hskhng02
2,058
Posted By chacko193
There is a typo in my last post. There should...
There is a typo in my last post. There should have been no space in the assignment operation.


# cat testIn
abc.conf
authpriv.* /var/log/secure...
10,378
Posted By RavinderSingh13
Hello, Here is an awk utility for same. ...
Hello,

Here is an awk utility for same.


awk 'gsub(/\,$/,X) 1' file_name



Output will be as follows.


Name,age,gender,location
Joel,18,M,Newyork
Monoj,21,M,Japan...
Showing results 1 to 8 of 8

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