10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
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
2. Shell Programming and Scripting
Hi,
cat test.txt
BlankLine
BlankLine
BlankLine
BlankLine
ello
hi
helo
BlankLine
BlankLine
heylo
BlankLine
BlankLine
BlankLine
done
BlankLine
BlankLine
BlankLine (1 Reply)
Discussion started by: TomG
1 Replies
3. UNIX for Advanced & Expert Users
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
4. Shell Programming and Scripting
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)
Discussion started by: rkumar28
4 Replies
5. Shell Programming and Scripting
Hi
Im trying to do the following in sed. I want to delete any blank line at the start of a file until it matches a pattern and then stops. for example:
Input
output:
I have got it to work within a range of two patterns with the following:
sed '/1/,/pattern/{/^]*$/d}'
The... (2 Replies)
Discussion started by: duonut
2 Replies
6. Shell Programming and Scripting
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)
Discussion started by: anil8103
5 Replies
7. Shell Programming and Scripting
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)
Discussion started by: omgsomuchppl
2 Replies
8. UNIX for Dummies Questions & Answers
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)
Discussion started by: visu
1 Replies
9. UNIX for Dummies Questions & Answers
can anyone show me how to delete blank lines from a file.
thanks in advance (2 Replies)
Discussion started by: sachin.gangadha
2 Replies
10. UNIX for Dummies Questions & Answers
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)
Discussion started by: vascobrito
3 Replies