10-01-2010
Delete a line between selected lines using sed or any other command
I want to delete a line between selected lines using sed:
e.g. : Between "bus" to "pins", delete lines conaining "signal" word.
Input :
bus
direction
signal new
signal old
pins
signal ok
end
Desired Output:
bus
direction
pins
signal
end
Please tell how to do it
10 More Discussions You Might Find Interesting
1. 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
2. Shell Programming and Scripting
Can any one help me how the sed delete only first line command (D) works.
sed -f sedcmds File.txt
In this how the sed delete only first line command (D) works to delete the blank lines appearing more than ones leaving only one blank and deleting others blanks.
While doing step by step when... (2 Replies)
Discussion started by: gwgreen1
2 Replies
3. Shell Programming and Scripting
HI,
I need one help to generate the file based on few condition,
I need to print only those line which has N and delete the line which as all Y's. ANd I need to compare only the fields which are marked as Y and N .
And one more thing is in the below file 1 and file 2 and file2 abc, dbc can... (6 Replies)
Discussion started by: rashmisb
6 Replies
4. Shell Programming and Scripting
HI,
Im using the below commmand to delete lines having "(" at the start of a line.
sed -e '/^(/d'
But i need a command to delete lines that has only "(" in it and no other strings.
infile -
asdf
asdf
( asdf
(
asd
outfile (1 Reply)
Discussion started by: dvah
1 Replies
5. Shell Programming and Scripting
Sample file:
This is line one,
this is another line,
this is the PRIMARY INDEX line
l ;
This is another line
The command should find the line with “PRIMARY INDEX” and remove the last character from the line preceding it (in this case , comma) and remove the first character from the line... (5 Replies)
Discussion started by: KC_Rules
5 Replies
6. Shell Programming and Scripting
I have a large data file that I need to edit. There are lines like,
> <IDNUMBER> (ST000002)
> <SUPPLIER> (ST000002)
> <IDNUMBER> (ST000004)
> <SUPPLIER> (ST000004)
and I need to delete everything after the >, excepting the end of line.
> <IDNUMBER>
> <SUPPLIER>
> <IDNUMBER>
> ... (4 Replies)
Discussion started by: LMHmedchem
4 Replies
7. Shell Programming and Scripting
Ultimate goal is to delete lines from before and after a block of lines in a given file. First attempt was something like this:
sed -e '1,/STARTUP/ d' inputfile.txt > outputfile.txt
but that deleted everything down to and including the line with STARTUP. I need to delete everything before... (6 Replies)
Discussion started by: edstevens
6 Replies
8. Shell Programming and Scripting
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies
9. Shell Programming and Scripting
hi Gurus,
I have a source file with more than 10 columns ( not fixed )
I want to delete all the lines on the following condition
1) where i have first column as "UPDATE PLAN ADD RATE SCHEDULE" and fourth column as null
awk '($1=="UPDATE PLAN ADD RATE SCHEDULE" && $4=="") {print $0}'... (5 Replies)
Discussion started by: r_t_1601
5 Replies
10. Shell Programming and Scripting
hello Team,
I want to delete below linux using sed command but I am getting error.sed -i '/url=/status.cgi?hostgroup=/d' 3
error:sed: -e expression #1, char 32: unknown option to `s'
Could you please help me with correct syntax.
My line contain / character because of that I am getting... (4 Replies)
Discussion started by: ghpradeep
4 Replies
LEARN ABOUT FREEBSD
bus_config_intr
BUS_CONFIG_INTR(9) BSD Kernel Developer's Manual BUS_CONFIG_INTR(9)
NAME
BUS_CONFIG_INTR -- configure interrupt polarity and trigger mode
SYNOPSIS
#include <sys/param.h>
#include <sys/bus.h>
int
BUS_CONFIG_INTR(device_t dev, int irq, enum intr_trigger trig, enum intr_polarity pol);
DESCRIPTION
The BUS_CONFIG_INTR() method allows bus or device drivers to provide interrupt polarity and trigger mode to parent busses. This typically
bubbles all the way up to the root bus (e.g. nexus) where the necessary actions are taken to actually program the hardware. Since the
BUS_CONFIG_INTR() method takes an interrupt number, it is assumed but not necessarily required that it is called prior to BUS_SETUP_INTR(9).
The trig argument can be one of:
INTR_TRIGGER_CONFORM The interrupt trigger mode is standard for the bus to which the device is attached.
INTR_TRIGGER_EDGE The interrupt is edge triggered. This means that the interrupt is raised by the rising edge of the signal on the
interrupt line. The signal typically reverts to the original state so as to cause a spike.
INTR_TRIGGER_LEVEL The interrupt is level triggered. This means that the interrupt is raised when the signal on the interrupt line tran-
sitions and remains unchanged after that until the interrupt has been serviced, after which the signal transitions
back.
The pol argument can be any one of:
INTR_POLARITY_CONFORM The interrupt polarity is standard for the bus to which the device is attached.
INTR_POLARITY_HIGH The interrupt is activated by a high voltage on the interrupt line.
INTR_POLARITY_LOW The interrupt is activated by a low voltage on the interrupt line.
RETURN VALUES
Zero is returned on success, otherwise an appropriate error is returned.
SEE ALSO
BUS_SETUP_INTR(9), BUS_TEARDOWN_INTR(9), device(9), driver(9)
HISTORY
The BUS_CONFIG_INTR() method first appeared in FreeBSD 5.2.
AUTHORS
This manual page was written by Marcel Moolenaar <marcel@xcllnt.net>.
BSD
January 6, 2005 BSD