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
cat test.txt
a
c
d
e
g (2 Replies)
Discussion started by: TomG
2 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
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
5. 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
6. UNIX for Dummies Questions & Answers
Hiiii
I have a file which contains huge data as
a.dat:
PDE 1990 1 9 18 51 28.90 24.7500 95.2800 118.0 6.1 0.0 BURMA
event name: 010990D
time shift: 7.3000
half duration: 5.0000
latitude: 24.4200
longitude: 94.9500
depth: 129.6000
Mrr: ... (7 Replies)
Discussion started by: reva
7 Replies
7. Shell Programming and Scripting
I need to print specific lines from a file, say 2-5, 8, 12-15, 17, 19, 21-27. How do I achieve this? (2 Replies)
Discussion started by: Ilja
2 Replies
8. 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
9. Shell Programming and Scripting
I have a text file with blank lines fullfilled with spaces and others only containing the "Enter" caracter, the \012.
I would like to eliminate all them with the sed command.
Is it possible?
making: sed '/^$/d' <file should delete the blank lines but doesn't work for the lines that only... (2 Replies)
Discussion started by: tmxps
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