Hi,
I am having an '.xml' file with 'n' number of lines and also having another file with '.txt' format contains values which i want to search.
Now I want to print the next line with the pattern which i am searching in '.xml' file. And the loop has to repeat for different patterns which... (5 Replies)
Hi,
I am having an '.xml' file with 'n' number of lines and also having another file with '.txt' format contains values which i want to search.
Now I want to print the next line with the pattern which i am searching in '.xml' file. And the loop has to repeat for different patterns which are... (4 Replies)
Hi,
I am trying to print multiple patterns in a line using sed. But it is printing only the last occurance of a pattern.
If the line is
the the output should be
Lookup Procedure|Stored proc
But the output I am getting is
Stored proc
The code I am using is
echo... (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)
Hi,
I need help to find matched patterns in 30 files residing in a folder simultaneously. All these files only contain 1 column. For example,
File1
Gr_1
st-e34ss-11dd
bt-wwd-fewq
pt-wq02-ddpk
pw-xsw17-aqpp
Gr_2
srq-wy09-yyd9
sqq-fdfs-ffs9
Gr_3
etas-qqa-dfw
ddw-ppls-qqw... (10 Replies)
Hi,
I need help to match pattern started with "RW" in file 1 and with pattern in $1 in file 2 as follows:-
File 1
BH /TOTAL=466(423); /POSITIVE=300(257); /UNKNOWN=25(25);
BH /F_P=141(141); /F_N=136; /P=4;
CC /TAX=!?; /MAX-R=2;
CC /VER=2;
RW P9610, AR_BSU , T; PAE25, AE_E57... (10 Replies)
Hi,
I could only find examples to print line before/after a match, but I'd need to print line after two separate lines matching.
E.g.: From the below log entry, I would need to print out the 1234. This is from a huge log file, that has a lot of entries with "CLIENT" and "No" entries (+ other... (3 Replies)
My input looks like this.
# Lot Of CODE Before
AppType_somethinglese=$(cat << EOF
AppType_test1='test-tool/blatest-tool-ear'
AppType_test2='test/blabla-ear'
# Lot Of CODE After
I want to print text betwen 1) _ and = and 2)/ and ' from each line
and exclude lines with "EOF".
Output... (2 Replies)
Hello.
For a given folder, I want to select any files find $PATH1 -f \( -name "*" but omit any files like pattern name ! -iname "*.jpg" ! -iname "*.xsession*" ..... \) and also omit any subfolder like pattern name -type d \( -name "/etc/gconf/gconf.*" -o -name "*cache*" -o -name "*Cache*" -o... (2 Replies)
Discussion started by: jcdole
2 Replies
LEARN ABOUT REDHAT
case
case(n) Tcl Built-In Commands case(n)
__________________________________________________________________________________________________________________________________________________NAME
case - Evaluate one of several scripts, depending on a given value
SYNOPSIS
case string ?in? patList body ?patList body ...?
case string ?in? {patList body ?patList body ...?}
_________________________________________________________________DESCRIPTION
Note: the case command is obsolete and is supported only for backward compatibility. At some point in the future it may be removed
entirely. You should use the switch command instead.
The case command matches string against each of the patList arguments in order. Each patList argument is a list of one or more patterns.
If any of these patterns matches string then case evaluates the following body argument by passing it recursively to the Tcl interpreter
and returns the result of that evaluation. Each patList argument consists of a single pattern or list of patterns. Each pattern may con-
tain any of the wild-cards described under string match. If a patList argument is default, the corresponding body will be evaluated if no
patList matches string. If no patList argument matches string and no default is given, then the case command returns an empty string.
Two syntaxes are provided for the patList and body arguments. The first uses a separate argument for each of the patterns and commands;
this form is convenient if substitutions are desired on some of the patterns or commands. The second form places all of the patterns and
commands together into a single argument; the argument must have proper list structure, with the elements of the list being the patterns
and commands. The second form makes it easy to construct multi-line case commands, since the braces around the whole list make it unneces-
sary to include a backslash at the end of each line. Since the patList arguments are in braces in the second form, no command or variable
substitutions are performed on them; this makes the behavior of the second form different than the first form in some cases.
SEE ALSO
switch(n)
KEYWORDS
case, match, regular expression
Tcl 7.0 case(n)