12-22-2008
grep -B 1 ^$ | egrep 'x|Y|Z' file
^$ for blank line and -B 1 prints blank line and before line
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
All I want is to look for the pattern in the file...If I found it at # places... I want print lines after those pattern(line) until I find a blank line.
Log EXAMPLE :
MT:Exception caught
The following Numbers were affected:
1234
2345
2346
Error
java.lang.InternalError:... (3 Replies)
Discussion started by: prash184u
3 Replies
2. Shell Programming and Scripting
Dear All-
Please suggest a single unix command which can append blank line in multiple files.
I need to achieve this using a single unix command and not a script
Please do advice
Regards,
Suresh (2 Replies)
Discussion started by: sureshg_sampat
2 Replies
3. Shell Programming and Scripting
Hello,
I have some data in a text file where fields are separated by blank lines. There are only 6 fields however some fields have several lines of data as I will explain. Also data in a particular field is not consistently the same size but does end on a blank line. The first field start with... (6 Replies)
Discussion started by: vestport
6 Replies
4. Shell Programming and Scripting
hello, here is an example:
9.07
9.05
0.00
2.28
0.00
0.08
1.93
3.62
10.97
12.03
12.03
0.00
2.73
0.00
0.07 (3 Replies)
Discussion started by: Baron1
3 Replies
5. Shell Programming and Scripting
Dear all
I want to search special string in file and then print next all line in one line until blank lines come. Help me plz for same. My input file and desire op file is as under.
i/p file:
A1/EXT "BSCABD1_21233G1" 757 130823 1157
RADIO X-CEIVER ADMINISTRATION
BTS EXTERNAL FAULT
... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies
6. Shell Programming and Scripting
All, I appreciate any help you can offer here as this is well beyond my grasp of awk/sed...
I have an input file similar to:
&LOG
&LOG Part: "@DB/TC10000021855/--F"
&LOG
&LOG
&LOG Part: "@DB/TC10000021852/--F"
&LOG Cloning_Action: RETAIN
&LOG Part: "@DB/TCCP000010713/--A"
&LOG
&LOG... (5 Replies)
Discussion started by: KarmaPoliceT2
5 Replies
7. Shell Programming and Scripting
Hi Everyone,
On my Linux box I have a text file having block of few lines and this block lines separated by one blank line. I would like to format and print these lines in such a way that this entire block of lines will come as single comma separated line & again next block of lines in next... (7 Replies)
Discussion started by: gr8_usk
7 Replies
8. Shell Programming and Scripting
Hi All
I have to search servers name say like 1000+ "unique names" line by line in child.txt files in another file that is a master file where all server present say "master.txt",if child.txt's server name matches with master files then it print yes else no with server name. (4 Replies)
Discussion started by: netdbaind
4 Replies
9. UNIX for Dummies Questions & Answers
Hi,
Test file x.txt below. This file is generated by a program that I unfortunately do not have control on how it gets presented/generated.
create PACKAGE "XXX_INTERFACE_DEFECT_RPT_TEST" is
TYPE refCursor IS REF CURSOR;
Function queryRecords (
p_status varchar2,
...
...
...
)... (4 Replies)
Discussion started by: newbie_01
4 Replies
10. Shell Programming and Scripting
Dear All,
In a CSV file, say that a given column has been extracted. In that column, information is missing (i.e. blank lines appear). I would like to replace the blank lines by the last valid line (not blank) previously read.
For example, consider the extract below:
123
234
543
111... (7 Replies)
Discussion started by: bagvian
7 Replies
XZGREP(1) XZ Utils XZGREP(1)
NAME
xzgrep - search compressed files for a regular expression
SYNOPSIS
xzgrep [grep_options] [-e] pattern file...
xzegrep ...
xzfgrep ...
lzgrep ...
lzegrep ...
lzfgrep ...
DESCRIPTION
xzgrep invokes grep(1) on files which may be either uncompressed or compressed with xz(1), lzma(1), gzip(1), or bzip2(1). All options
specified are passed directly to grep(1).
If no file is specified, then the standard input is decompressed if necessary and fed to grep(1). When reading from standard input,
gzip(1) and bzip2(1) compressed files are not supported.
If xzgrep is invoked as xzegrep or xzfgrep then egrep(1) or fgrep(1) is used instead of grep(1). The same applies to names lzgrep, lze-
grep, and lzfgrep, which are provided for backward compatibility with LZMA Utils.
ENVIRONMENT
GREP If the GREP environment variable is set, xzgrep uses it instead of grep(1), egrep(1), or fgrep(1).
SEE ALSO
grep(1), xz(1), gzip(1), bzip2(1), zgrep(1)
Tukaani 2009-07-05 XZGREP(1)