I did share a link to a relevant thread in my previous post - it should answer your exact question.
your shared link showed how to display contextual lines, which I said I was already able to do properly with the grep -C or grep -2 options... not remove them.
---------- Post updated at 12:07 PM ---------- Previous update was at 12:07 PM ----------
Quote:
Originally Posted by durden_tyler
tyler_durden
nice! this is pretty clean and easy to read, as well.. thanks.
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 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)
Dear All
I have a file like this
112534554
446538656
444695656
225696966
226569744
228787874
113536566
443533535
222564552
115464656
225445345
225533234
I want to cut the file into different parts where the first two columns are '11' . The first two columns will be either... (3 Replies)
Hi all,
I have a text data file. My aim here is to find line called *FIELD* AV for every record and print lines after that till *FIELD* RF. But here I want first 3 to four lines for very record as well. FIELD AV is some where in between for very record. SO I am not sure how to retrieve lines in... (2 Replies)
Hi,
i need help to delete all the lines between 2 matched patterns and the first pattern must be deleted too. sample as follows:
inputfile.txt
>kump_1
...........................
...........................
>start_0124
dgfhghgfh
fgfdgfh
fdgfdh
>kump_2
............................. (7 Replies)
hello everyone,
im new here, and also programming with awk, sed and grep commands on linux.
In my text i have many lines with this config:
1 1 4 3 1 1 2 5
2 2 1 1 1 3 1 2
1 3 1 1 1 2 2 2
5 2 4 1
3 2 1 1 4 1 2 1
1 1 3 2 1 1 5 4
1 3 1 1... (3 Replies)
Hi Everybody! First post! Totally noobie.
I'm using the terminal to read a poorly formatted book.
The text file contains, in the middle of paragraphs, hyphenation to split words that are supposed to be on multiple pages. It looks ve -- ry much like this.
I was hoping to use grep -v " -- "... (5 Replies)
Hello.
Question 1 :
I want to comment out all lines of a cron file which are not already commented out for each full path pattern matched.
Example 1 nothing to do because line is already commented out; pattern = '/usr/bin/munin-cron'
# */5 * * * * munin test -x... (3 Replies)
Discussion started by: jcdole
3 Replies
LEARN ABOUT SUSE
fnmatch
FNMATCH(3) Linux Programmer's Manual FNMATCH(3)NAME
fnmatch - match filename or pathname
SYNOPSIS
#include <fnmatch.h>
int fnmatch(const char *pattern, const char *string, int flags);
DESCRIPTION
The fnmatch() function checks whether the string argument matches the pattern argument, which is a shell wildcard pattern.
The flags argument modifies the behavior; it is the bitwise OR of zero or more of the following flags:
FNM_NOESCAPE
If this flag is set, treat backslash as an ordinary character, instead of an escape character.
FNM_PATHNAME
If this flag is set, match a slash in string only with a slash in pattern and not by an asterisk (*) or a question mark (?)
metacharacter, nor by a bracket expression ([]) containing a slash.
FNM_PERIOD
If this flag is set, a leading period in string has to be matched exactly by a period in pattern. A period is considered to be
leading if it is the first character in string, or if both FNM_PATHNAME is set and the period immediately follows a slash.
FNM_FILE_NAME
This is a GNU synonym for FNM_PATHNAME.
FNM_LEADING_DIR
If this flag (a GNU extension) is set, the pattern is considered to be matched if it matches an initial segment of string which is
followed by a slash. This flag is mainly for the internal use of glibc and is only implemented in certain cases.
FNM_CASEFOLD
If this flag (a GNU extension) is set, the pattern is matched case-insensitively.
RETURN VALUE
Zero if string matches pattern, FNM_NOMATCH if there is no match or another nonzero value if there is an error.
CONFORMING TO
POSIX.2. The FNM_FILE_NAME, FNM_LEADING_DIR, and FNM_CASEFOLD flags are GNU extensions.
SEE ALSO sh(1), glob(3), scandir(3), wordexp(3), glob(7)COLOPHON
This page is part of release 3.25 of the Linux man-pages project. A description of the project, and information about reporting bugs, can
be found at http://www.kernel.org/doc/man-pages/.
GNU 2000-10-15 FNMATCH(3)