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
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)
Discussion started by: slimjbe
6 Replies
3. Shell Programming and Scripting
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)
Discussion started by: DeuceLee
3 Replies
4. Shell Programming and Scripting
delete last X lines,which start with +
example file:
test1
test2
remove1
remove2
one liner shell is preferred. (8 Replies)
Discussion started by: honglus
8 Replies
5. Shell Programming and Scripting
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)
Discussion started by: plelie2
11 Replies
6. UNIX for Dummies Questions & Answers
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)
Discussion started by: ifermon
0 Replies
7. Shell Programming and Scripting
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)
Discussion started by: radha.kalivar
9 Replies
8. UNIX for Dummies Questions & Answers
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)
Discussion started by: selkirk
2 Replies
9. Shell Programming and Scripting
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)
Discussion started by: whatisthis
3 Replies
10. Shell Programming and Scripting
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)
Discussion started by: bookoo
2 Replies