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)
I am attempting to delete blank lines in my file and I've used this command:
sed '/^$/d' $file > $file.fixed
all this seems to do is copy the file and not delete the blank lines located at the end of the file. Any assistance would be greatly appreciated. (3 Replies)
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 want to use diff to compare two files in a Perl file. But one of the files has some blank lines at the end. So I want to delete the blank lines from the file firstly and then use diff to compare them. But I dont know how to delete the blank lines from the files. Meanwhile, the system is... (5 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)
Hi,
I tried the following options but was unable to delete blank lines from file
Input file = temp.hash.txt
temp.hash.txt content
90
0
89.56
0
0
57575.4544
56.89 (9 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 DEBIAN
yexpand
YEXPAND(1) General Commands Manual YEXPAND(1)NAME
yexpand - tool to expand environment variables in Nypatchy cradles
SYNOPSIS
yexpand inputfile [ outputfile ]
DESCRIPTION
yexpand is a very simple script to expand environment variables in a text file to their current values in the shell environment. It was
written to be used with nypatchy cradles. It is recommended you not try to use it for any other purposes (note BUGS below).
USAGE
yexpand takes inputfile as input, replaces all instances of shell variables (in the form $VARIABLE or ${VARIABLE}) with their current val-
ues in the environment, and saves the result to outputfile. Undefined variables are replaced with the empty string. If outputfile is not
given, the result is instead saved to the current directory as a file of the same name as inputfile. Thus an input file in the current
directory will be overwritten.
BUGS
This script is very simple-minded. Since it basically just echos its input file as a here-doc, it will attempt to perform all types of
shell substitution (command substitution, etc.) as well as variable substitution. Hence it is likely to fail on anything except the very
simplest text files.
Additionally, this script creates a temporary file. The file is created in the current directory, so there should not be security implica-
tions. However, any existing file named file.yexp (where file is the basename of inputfile) in the current directory will be overwritten
and then deleted.
SEE ALSO fcasplit(1), nycheck(1), nydiff(1), nyindex(1), nylist(1), nymerge(1), nypatchy(1), nyshell(1), nysynopt(1), nytidy(1)
The reference manual for the Nypatchy suite of programs is available in compressed PostScript format at the following URL:
http://wwwasdoc.web.cern.ch/wwwasdoc/psdir/p5refman.ps.gz
AUTHOR
This manual page was written by Kevin McCarty <kmccarty@debian.org> for the Debian GNU/Linux system (but may be used by others). It is
licensed under the GNU General Public License, version 2 or later (at your choice).
COPYRIGHT
Copyright (C) Kevin B. McCarty, 2008.
Mar 12, 2008 YEXPAND(1)