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 have file of more than 10000 lines.
I want to delete 40 lines after every 20 lines.
e.g from a huge file, i want to delete line no from 34 - 74, then 94 - 134 etc and so on.
Please let me know how i can do it.
Best regards, (11 Replies)
Discussion started by: nehashine
11 Replies
3. 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
4. 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
5. UNIX for Advanced & Expert Users
Hi All,
I have a very huge file (4GB) which has duplicate lines. I want to delete duplicate lines leaving unique lines. Sort, uniq, awk '!x++' are not working as its running out of buffer space.
I dont know if this works : I want to read each line of the File in a For Loop, and want to... (16 Replies)
Discussion started by: krishnix
16 Replies
6. Shell Programming and Scripting
Hello,
I have a group of text files with many lines in each file.
I need to delete all the lines in each and only leave 2 lines in each file. (3 Replies)
Discussion started by: script_op2a
3 Replies
7. 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
8. 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
9. Shell Programming and Scripting
Hi,
I am writing a shell script that needs to remove duplicate lines within a file by category.
example:
section a
a
c
b
a
section b
a
b
a
c
I need to remove the duplicates within th category with out removing the duplicates from the 2 different sections (one of the a's in section... (1 Reply)
Discussion started by: RichElks
1 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