As the field separator is "|" (not blank; sorry, i didn't mention this in my original post) i tried below but getting blank output. As i am using Solaris, i used "gawk".
Please note that whatever i am grepping (ex. 2222) need not be in the first line (line with AA).
There is a file which logs all errors and alerts of the database called alert log. I have a requirement as follows:
1. Check the current date and search for the first occurance of the current date in the alert log.
2. As soon as the first occurance is found, copy the subsequent contents... (5 Replies)
I have a file like this..
Maharastra Mumbai worli
Maharastra Mumbai navy
maharatra Pune
Maharastra Nagpur
Karnataka Bangalore
Karnataka Mysore
Karnataka Mangalore
Punjab Amritsar
punjab Jalandar
my expected outcome should be like this
Maharastra Mumbai worli
---------- ... (9 Replies)
Hi all,I am really new to Shell Scripting.I have the following doubt.
Let us assume the one sample file which contains the below data
HEADERCARMENTRACIE1555090414
PERIOD0905090501090531
DETAIL0645693037023073836
GROUNDAV 090501 01
GROUNDAV 090502 01
TRIP 0091282542 0905084101... (5 Replies)
Hi all,
I am looking for a coomand to search for the keywords in susequenct lines. Keyword1 in a line and Keyword2 in the very next line.
Once i found the combination ineed to print the lines with patterns and the line above and one below.
I am giving an example here: Keywords are :ERROR and... (12 Replies)
I have my data something like this
I need to search for the keyword yyyy in the susequent lines and if it is present, delete the second line with keyword.
In other words, if a keywords is found in two subsequent lines delete the second line.
input data:
aaaa bbbbb cccc dddd
xxxx... (4 Replies)
I've run into a problem getting exactly what I want out of awk - some folks may recognize this as an output from Amazon's ec2-describe-instances:
Given the following:
INSTANCE i-4960f321
BLOCKDEVICE Line2Var2
TAG instance i-4960f321 Name web1
TAG instance i-4960f321... (2 Replies)
Hi,
I have got the below requirement. please suggest.
I have a file like,
Processing Item is:
/data/ing/cfg2/abc.txt
/data/ing/cfg3/bgc.txt
Processing Item is:
/data/cmd/for2/ght.txt
/data/kernal/config.klgt.txt
I want to process the above file to get the output file like,
... (5 Replies)
Hi,
I have a requirement like, I have a list of pattens in a file say pattern.txt,
PHC111
PHC113
and in another file called master.lst i have entries like,
PHC111
a
b
PHC112
a
PHC113
b
c
PHC114
d
e (5 Replies)
I have a simple xml file,need the output with the <value> tag and <result> tag
text.xml
<test-method status="FAIL" duration="45">
<value>
Id=C18
</value>
<result>
wrong paramter
</result>
</test-method>
<test-method status="FAIL" duration="45">
<value>
Id=C19
</value>
<result>
Data... (5 Replies)
Discussion started by: DevAakash
5 Replies
LEARN ABOUT ULTRIX
cat
cat(1) General Commands Manual cat(1)Name
cat - concatenate and print data
Syntax
cat [ -b ] [ -e ] [ -n ] [ -s ] [ -t ] [ -u ] [ -v ] file...
Description
The command reads each file in sequence and displays it on the standard output. Therefore, to display the file on the standard output you
type:
cat file
To concatenate two files and place the result on the third you type:
cat file1 file2 > file3
To concatenate two files and append them to a third you type:
cat file1 file2 >> file3
If no input file is given, or if a minus sign (-) is encountered as an argument, reads from the standard input file. Output is buffered in
1024-byte blocks unless the standard output is a terminal, in which case it is line buffered. The utility supports the processing of 8-bit
characters.
Options-b Ignores blank lines and precedes each output line with its line number.
-e Displays a dollar sign ($) at the end of each output line.
-n Precedes all output lines (including blank lines) with line numbers.
-s Squeezes adjacent blank lines from output and single spaces output.
-t Displays non-printing characters (including tabs) in output. In addition to those representations used with the -v option, all tab
characters are displayed as ^I.
-u Unbuffers output.
-v Displays non-printing characters (excluding tabs and newline) as the ^x. If the character is in the range octal 0177 to octal 0241,
it is displayed as M-x. The delete character (octal 0177) displays as ^?. For example, is displayed as ^X.
See Alsocp(1), ex(1), more(1), pr(1), tail(1)cat(1)