File contents:
BEG
Id Job1
Id Stage1
1
EN
Id Job2
Id Stage2
BEG
Id2 Job3
Id Stage4
2
EN
I have to process the data in this between every BEG and EN. so I am trying to restrict the range and inside every range, Is there a way to define another range like below..
The reason is that there are so many lines with same keyword, I just need the very first one.
And also there are many subsets inside BEG and EN (not shown in sample file) so I need to process the lines between these in groups inside every BEG and EN which would be easier if there was a way to recursively define pattern rangers inside awk.
set -A arr a1 a2 a3 a4
# START
ssh -xq $Server1 -l $Username /usr/bin/ksh <<-EOS
integer j=0
for loop in ${arr}
do
printf "array - ${arr}\n"
(( j = j + 1 ))
j=`expr j+1`
done
EOS
# END
=========
this is not giving me correct output.
I... (5 Replies)
I cannot seem to get this text file to format. Its as if the awk statement is being treated as a simple cat command.
I manned awk and it was very confusing. I viewed previous posts on this board and I got the same results as with the
the awk command statement shown here. Please help.
... (6 Replies)
I want to check if a zip code is valid, using a variable that stores the zipcode. I am not sure how I would do this in a script. I know that simply checking for the numerical range of the number will not work, because '1' would be '00001' in zip code format. I know when I am in shell, I can use... (5 Replies)
Trying to sum field #6 when field #2 matches string as follows:
Input data:
2010-09-18-20.24.44.206117 UOWEXEC db2bp DB2XYZ hostname 1
2010-09-18-20.24.44.206117 UOWWAIT db2bp DB2XYZ hostname ... (3 Replies)
Hi, I need to create weekly files from daily records stored in individual monthly filenames from 1999-2010. my sample file structure is like the ones below:
daily record stored per month:
199901.xyz, 199902.xyz, 199903.xyz, 199904.xyz ...199912.xyz
records inside 199901.xyz (original data... (4 Replies)
I have been struggling with a script to automate some security related activities. I have it pretty much working, all except the search. I have an input file formatted as such:
216.234.246.158 216.234.246.158 ``
24.249.221.22 24.249.221.200 ``
24.249.226.0 ... (4 Replies)
Learning, stumbling! My progress in shell scripting is slow. Now I have this doubt:
I have the following file (users.txt):
AU0909,on
AU0309,off
AU0209,on
AU0109,off
And this file (userson.txt)
AU0909
AU0209
AU0109
AU0309
I just want to set those users on userson.txt to "off" in... (14 Replies)
Hi
i am in learning phase of unix
i am able to understand basic of awk but not able to understand Pattern-Specific Actions in awk below is the snippet .
awk '
/ *\$*\. */ { print $1,$2,$3,"*"; }
/ *\$0\. */ { print ; }
' fruit_prices.txthere i am not getting the use of wild card. what... (4 Replies)
hi all,
Say i have a range like 0 - 1000 and i need to split into diffrent files the lines which are within a specific fixed sub-range. I can achieve this manually but is not scalable if the range increase.
E.g
cat file1.txt
Response time 2 ms
Response time 15 ms
Response time 101... (12 Replies)
Discussion started by: varu0612
12 Replies
LEARN ABOUT HPUX
wildmat
WILDMAT(3) Library Functions Manual WILDMAT(3)NAME
wildmat - perform shell-style wildcard matching
SYNOPSIS
int
wildmat(text, pattern)
char *text;
char *pattern;
DESCRIPTION
Wildmat is part of libinn (3). Wildmat compares the text against the pattern and returns non-zero if the pattern matches the text. The
pattern is interpreted according to rules similar to shell filename wildcards, and not as a full regular expression such as those handled
by the grep(1) family of programs or the regex(3) or regexp(3) set of routines.
The pattern is interpreted as follows:
x Turns off the special meaning of x and matches it directly; this is used mostly before a question mark or asterisk, and is not spe-
cial inside square brackets.
? Matches any single character.
* Matches any sequence of zero or more characters.
[x...y]
Matches any single character specified by the set x...y. A minus sign may be used to indicate a range of characters. That is,
[0-5abc] is a shorthand for [012345abc]. More than one range may appear inside a character set; [0-9a-zA-Z._] matches almost all of
the legal characters for a host name. The close bracket, ], may be used if it is the first character in the set. The minus sign,
-, may be used if it is either the first or last character in the set.
[^x...y]
This matches any character not in the set x...y, which is interpreted as described above. For example, [^]-] matches any character
other than a close bracket or minus sign.
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> in 1986, and posted to Usenet several times since then, most notably in comp.sources.misc in
March, 1991.
Lars Mathiesen <thorinn@diku.dk> enhanced the multi-asterisk failure mode in early 1991.
Rich and Lars increased the efficiency of star patterns and reposted it to comp.sources.misc in April, 1991.
Robert Elz <kre@munnari.oz.au> added minus sign and close bracket handling in June, 1991.
This is revision 1.10, dated 1992/04/03.
SEE ALSO grep(1), regex(3), regexp(3).
WILDMAT(3)