10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
<VirtualHost 192.168.1.158:80>
DocumentRoot /home/ten
ServerName ten.com
</VirtualHost>
<VirtualHost 192.168.1.158:80>
DocumentRoot /home/sachin
ServerName sachin.com
</VirtualHost>
<VirtualHost 192.168.1.158:80>
DocumentRoot /home/yuvraj
ServerName yuvraj.com... (5 Replies)
Discussion started by: tkmmelvin
5 Replies
3. Shell Programming and Scripting
I need to copy lines to a new file from files with sed using a pattern in char postions 1-3.
Then after the copy, I need to delete those same lines from the input files.
For example, string "ABC" in pos 1-3 (6 Replies)
Discussion started by: laksjfhoius9123
6 Replies
4. Shell Programming and Scripting
Hi
I would like to batch delete the "note" entry from bib files. The start would be defined by "note ={" and the end by "}." (see example bib entry below).
I tried the following command which does not have any effect:
cat input.bib| sed -e 's/note = {.*}.//' > output.bib
Any help would... (2 Replies)
Discussion started by: gerggeismann
2 Replies
5. Shell Programming and Scripting
Hello everyone I'm doing a program in bash and wanted to know how can I do to delete document lines the words not ending in S with SED, ie, show only those ending with the letter S.
I probe with:
sed -e /$.*/d "$file" | more
to delete all lines NOT ending in S but not work!... (3 Replies)
Discussion started by: adiegorpc
3 Replies
6. Shell Programming and Scripting
Hi,
I'm very new to Sed and I have a very large file that contains data in the following way
(*064) 1 4 10
(*064) simulation time = 0.12000E-05
(*064) 1 2 10
(*064) 1 3 10Essentially what I want to do it delete every line that starts with
'(*064) 1'I tried the following,
... (2 Replies)
Discussion started by: lost.identity
2 Replies
7. Shell Programming and Scripting
Hi All,
I have one /etc/hosts.equiv file which has following entries
##########
wcars42g admin
wcars42b netmgr
wcars42b oemssrvr
wcars42f admin
wcars42f netmgr
wcars42f oemssrvr
##########
I am trying to delete lines starting from wcars42b.... (1 Reply)
Discussion started by: akash_mahakode
1 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
I have files of more than 10K lines that I need to delete lines that contain a pattern, but I want to keep the first few lines intact. Can this be done with sed? (7 Replies)
Discussion started by: tkg
7 Replies
10. Shell Programming and Scripting
I have been reading through the sed one liners, trying to understand what is happening.
# delete the last 2 lines of a file
sed 'N;$!P;$!D;$d'
The above will delete the last 2 line of a file. I tried analyzing what happens. And I got lost :(
This is what I understood so far from the... (2 Replies)
Discussion started by: vino
2 Replies