Every line that matches WARNING sets W=2. Every line, whether it matches or not, decrements W. So a matching line in effect sets it to 1. The statement at the end of the {} prevents printing when W > 0, which avoids one or more warning lines in a row plus one line after. You could change W=2 to W=3 if you wanted to skip two lines after.
These 2 Users Gave Thanks to Corona688 For This Post:
Hi all,
I am trying to figure out the syntx to delete multiple lines w/ sed. I know the following syntax will delete lines 1 THROUGH 5 from filex:
sed 1,5d filex
But I wan to delete lines 1 AND 5 (keeping lines 2,3, and 4). Does anyone know how to do this in a single sed statement?
... (2 Replies)
Hi,
I need to delete the lines with empty name.
What is the best way to do it?
Thanks a lot for your help!
EMID MMDDYY HOURS JOB EMNAME
0241 051605 11.40 52062 someone
0520 051605 10.63 52062
0520 051605 10.66 52062
0520 051605 10.65 52062 (3 Replies)
Good morning,
Novice scripter in Unix here, and I've run into and sed task I can't quite wrap my head around. I'm pulling my hair out fast enough as it is and thought I would go to the knowledge bank.
I have a sorted file that I'm trying to trim down by deleting any line whose first few... (2 Replies)
file1 contains the following data
sssssssssss
firstline
secondline pppppppppp
ssssssssss
Using sed comamnd i am trying to delete firtsline secondline.
so, output should be
sssssssssss
pppppppppp
ssssssssss
I tried in the following the way, but it is not working.
sed ... (9 Replies)
I've done this before but I can't remember how. Too long away from vi.
I want to do a search are replace, but I want the replace to be a join.
Example
see spot run
see spot walk
see spot run fast
see spot hop
%s/run$/<somehow perform a join with the next line>/g
so the results... (0 Replies)
First of all, I know this can be more eassily done with perl or other scripting languages but, that's not the issue. I need this in sed. (or wander if it's possible )
I got a file (trace file to recreate the control file from oracle for the dba boys)
which contains
some lines
another line... (11 Replies)
hey guys,
I tried searching but most 'search and replace' questions are related to one liners.
Say I have a file to be replaced that has the following:
$ cat testing.txt
TESTING
AAA
BBB
CCC
DDD
EEE
FFF
GGG
HHH
ENDTESTING
This is the input file: (3 Replies)
Hello,
I'm trying to figure out how to use sed or awk to delete single lines in a file. By single, I mean lines that are not touching any other lines (just one line with white space above and below).
Example:
one
two
three
four
five
six
seven
eight
I want it to look like: (6 Replies)
Hi all,
I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex:
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 15
parameter_2 = 1
parameter_3 = 0
user: alpha
parameter_1 = 16... (3 Replies)
Discussion started by: ce9888
3 Replies
LEARN ABOUT SUSE
g3cat
g3cat(1) mgetty+sendfax manual g3cat(1)NAME
g3cat - concatenate multiple g3 documents
SYNOPSIS
g3cat [-l] [-a] g3-file1 ...
DESCRIPTION
g3cat concatenates g3 files. These can either be 'raw', that is, bitmaps packed according to the CCITT T.4 standard for one-dimensional
bitmap encoding, or 'digifax' files, created by GNU's GhostScript package with the digifax drivers. Its output is a concatenation of all
the input files, in raw G3 format, with two white lines in between.
If a - is given as input file, stdin is used.
If the input data is malformed, a warning is printed to stderr, and the output file will have a blank line at this place.
OPTIONS -l separate files with a one-pixel wide black line.
-h <blank lines>
specifies the number of blank lines g3cat should prepend to each page. Default is 0.
-L <lines>
limit lenght of output page to maximum <lines> lines.
SPECIAL-CASE OPTIONS-w <width>
specifies the desired page width in pixels per line. Default is 1728 PELs, and this is mandatory if you want to send the fax to a
standard fax machine. If one of the input files doesn't match this line width (for example because it was created by a broken G3
creator), a warning is printed, and the line width is transparently fixed.
-a byte-align the end-of-line codes (EOL) in the file. Every EOL will end at a byte boundary, that is, with a 01 byte.
-p <pad>
specifies a minimum number of bytes that each output line must be padded to. Padding is done with 0-bits before the EOL code.
-R suppress output of end-of-page code (RTC).
Example
The following example will put a header line on a given g3 page, 'page1' and put the result into 'page2':
echo '$header' | pbmtext | pbm2g3 | g3cat - page1 >page2
FILES --
BUGS
Hopefully none :-).
SEE ALSO g32pbm(1), sendfax(8), faxspool(1)AUTHORS
g3cat is Copyright (C) 1993 by Gert Doering, <gert@greenie.muc.de>
greenie 27 Oct 93 g3cat(1)