Delete multiple lines between blank lines containing two patterns
Hi all,
I'm looking for a way (sed or awk) to delete multiple lines between blank lines containing two patterns ex:
I want to delete the paragraph containing the same user and the same parameter_1, in the exemple: user=alpha and parameter_1=15 . The expected result should be:
hi there
i'm trying to delete blank lines and or lines with spaces only from a series of files in an directory.
to do so, i'm using this:
for files in `ls /users/myname/pesop* 2>/dev/null`
do
grep -v ^$ $files > newfile
mv newfile $files
done
now, this works great for blank lines but... (3 Replies)
can't figure out a way to delete multiple empty lines but keep single empty lines in a file, file is like this
#cat file
1
2
3
4
5
6
-
What I want is
1
2 (6 Replies)
Hi,
I have blank line in the file, I just want to remove trailing blank lines.
There are some blank lines between the lines, i don't want remove those.
Just want to delete blank lines at the end.
I used this command sed '/^$/d' infile > outfile, but it is not removing anything.
I think... (1 Reply)
I have a sed pipeline:
myVar=$(cat $FILE | sed -n '/regex/,/regex/{/regex/d;p}' | sed -n '/regex/!p' | sed -e s/*:// | sed /regex/,+8d \
)
sed '/^$/d'
sed '/./!d'
And i've tried to add that in a different order rather then just on the end..Why isnt it deleting all the blank... (2 Replies)
Hi, I've searched in this forum all day long but was not able to find enough codes to help me do a task. The only code that I can come up with is this:
sed '/ /,/ /{//p;d;}' inputfile > outputfile
I would like to sed/awk/grep a file for two patterns and then delete the lines between... (4 Replies)
Hi,
Consider a file named "testfile"
The contents of file are as below
first line added for test
second line added for test
third line added for test
fourth line added for test
fifth line added for test (5 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)
Hi All,
I have a file and I need to delete the lines that are blank and is starting with some characters below. Something like below:
Regular Ascii File:
Line1: AGODA1 BUSAN||SK Lord Beach 4/6/2012 4/7/2012 68060
Line2: AGODA2 BUSAN||SK Beach Hotel 4/6/2012 4/7/2012 610200
Line3: ... (4 Replies)
Hi Gurus,
Somebody can say me how to delete blank spaces and blank lines in a file unix, please.
Thank you for advanced. (10 Replies)
Discussion started by: systemoper
10 Replies
LEARN ABOUT OSF1
ximtoppm
ximtoppm(1) General Commands Manual ximtoppm(1)NAME
ximtoppm - convert an Xim file into a portable pixmap
SYNOPSIS
ximtoppm [--alphaout={alpha-filename,-}] [ximfile]
DESCRIPTION
Reads an Xim file as input. Produces a portable pixmap as output. The Xim toolkit is included in the contrib tree of the X.V11R4 release.
OPTIONS --alphaout=alpha-filename
ximtoppm creates a PGM (portable graymap) file containing the alpha channel values in the input image. If the input image doesn't
contain an alpha channel, the alpha-filename file contains all zero (transparent) alpha values. If you don't specify --alphaout,
ximtoppm does not generate an alpha file, and if the input image has an alpha channel, ximtoppm simply discards it.
If you specify - as the filename, ximtoppm writes the alpha output to Standard Output and discards the image.
Actually, an Xim image can contain an arbitrary fourth channel -- it need not be an Alpha channel. ximtoppm extracts any fourth
channel it finds as described above; it doesn't matter if it is an alpha channel or not.
See pnmcomp(1) for one way to use the alpha output file.
All options can be abbreviated to their shortest unique prefix.
SEE ALSO pnmcomp(1), ppm(5)AUTHOR
Copyright (C) 1991 by Jef Poskanzer.
April 2, 2000 ximtoppm(1)