@R.Singh
Must be > not \>. The latter has a special meaning "right word boundary" in many sed versions.
Here is another sed solution (IMHO ugly compared to the awk solution):
Last edited by MadeInGermany; 08-01-2013 at 08:24 AM..
This User Gave Thanks to MadeInGermany For This Post:
Hi all,
I have the following data in a file x.csv:
> ,this is some text here
> ,,,,,,,,,,,,,,,,2006/11/16,0.23
> ,,,,,,,,,,,,,,,,2006/12/16,0.88
< ,,,,,,,,,,,,,,,,this shouldnt be deleted
I need to use SED to match anything with a > in the line and delete that line, can someone help... (7 Replies)
I am really need help with the regular expression in SED. From input file, I need to extract lines that have the port number (sport or dport) as defined. The input file is something like this
time=1209515280-1209515340 dst=192.168.133.202 src=208.70.8.23 bytes=2472 proto=6 sport=80 dport=1447... (6 Replies)
I want to delete lines like this
sed '/FROM_HERE/,/TO_HERE/d'
but I would like to *not* delete the second match, i.e. the TO_HERE line. How can I achieve this?
Thank you! (1 Reply)
Friends,
I have .txt file with following format.
START
ABC|Prashant1|Patel1
ABC|Prashant2|Patel2
ABC|Prashant1|Patel1
ABC|Prashant2|Patel2
END
I would like to do:
1) Delete line with START
2) Delete line with END
3) Remove ABC|
4) Delete duplicate records
The following command... (7 Replies)
I have an ugly conf file that has the string I'm interested in searching for in the middle of a block of code that's relevant, and I'm trying to find a way to remove that entire block based on the matched line.
I've googled for this problem, and most people helping are only interested in... (9 Replies)
Hello Friends,
I need to print lines in between two string when a keyword existed in those lines (keywords like exception, error, failed, not started etc).
for example,
input:
..
Begin Edr
ab12
ac13
ad14
bc23
exception occured
bd24
cd34
dd44
ee55
ff66
End Edr (2 Replies)
Hello,
I have been trying to write a script where I could get awk to delete data before and after a matched pattern.
For eg
Raw data
Start
NAME = John
Age = 35
Occupation = Programmer
City = New York
Certification Completed = No
Salary = 80000
End
Start
NAME = Mary
Age = 25... (2 Replies)
Hi all,
I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex:
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies
LEARN ABOUT NETBSD
fnmatch
FNMATCH(3) BSD Library Functions Manual FNMATCH(3)NAME
fnmatch -- match filename or pathname using shell glob rules
LIBRARY
Standard C Library (libc, -lc)
SYNOPSIS
#include <fnmatch.h>
int
fnmatch(const char *pattern, const char *string, int flags);
DESCRIPTION
The fnmatch() function matches patterns according to the globbing rules used by the shell. It checks the string specified by the string
argument to see if it matches the pattern specified by the pattern argument.
The flags argument modifies the interpretation of pattern and string. The value of flags is the bitwise inclusive OR of any of the following
constants, which are defined in the include file fnmatch.h.
FNM_NOESCAPE Normally, every occurrence of a backslash ('') followed by a character in pattern is replaced by that character. This is
done to negate any special meaning for the character. If the FNM_NOESCAPE flag is set, a backslash character is treated
as an ordinary character.
FNM_PATHNAME Slash characters in string must be explicitly matched by slashes in pattern. If this flag is not set, then slashes are
treated as regular characters.
FNM_PERIOD Leading periods in strings match periods in patterns. The definition of ``leading'' is related to the specification of
FNM_PATHNAME. A period is always ``leading'' if it is the first character in string. Additionally, if FNM_PATHNAME is
set, a period is ``leading'' if it immediately follows a slash.
FNM_LEADING_DIR Ignore ``/*'' rest after successful pattern matching.
FNM_CASEFOLD The pattern is matched in a case-insensitive fashion.
RETURN VALUES
The fnmatch() function returns zero if string matches the pattern specified by pattern, otherwise, it returns the value FNM_NOMATCH.
SEE ALSO sh(1), glob(3), regex(3), glob(7)STANDARDS
The fnmatch() function conforms to IEEE Std 1003.2-1992 (``POSIX.2''). The FNM_CASEFOLD flag is a NetBSD extension.
HISTORY
The fnmatch() function first appeared in 4.4BSD.
BUGS
The pattern '*' matches the empty string, even if FNM_PATHNAME is specified.
BSD November 30, 2010 BSD