09-20-2010
How to remove a specific line matching pattern1 and pattern2 ?
Hi,
I have a file like below:
.
.
.
.
Jack is going home
Jack is going to school
Jack is sleeping
Jack is eating dinner
John is going home
John is eating breakfast
.
.
.
The specific line is:
Jack is going home
As you can see, pattern1=Jack, pattern2=home
So, how can I remove this line matching the pattern1 and the pattern2 ?
Thanks in advance...
salih
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
My data is xml'ish (here is an excerpt) :-
<bag name="mybag1" version="1.0"/>
<contents id="coins"/>
<bag name="mybag2" version="1.1"/>
<contents id="clothes"/>
<contents id="shoes"/>
<bag name="mybag3" version="1.6"/>
I want to delete line containing mybag2 and its subsequent... (5 Replies)
Discussion started by: repudi8or
5 Replies
2. Shell Programming and Scripting
Hi!
From a file like this one :
hello
...
PATTERN1
...
lines between patterns
..
PATTERN2
...
I would like to extract only the lines between patterns, probably with awk I think?
Thanks a lot for your help,
Tipi (5 Replies)
Discussion started by: tipi
5 Replies
3. Shell Programming and Scripting
Hi,
From the sample file below
Conditions
1) Pattern Range must start with "ALTER TABLE"
2) Pattern Range ends when it finds ";"
3) Between this range i want to select all the patterns that contain pattern " MOVE "
Note : I would like to exclude the above pattern matches and print... (1 Reply)
Discussion started by: rajan_san
1 Replies
4. Shell Programming and Scripting
Hi,
Here is a sample of my Test File
$ cat TestFile1
Prompt Table DQZ_ALTER_SCHEMA_ID;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID MONITORING;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID STORAGE ( NEXT 3464K );
Prompt Table DQZ_ALTER_SCHEMA_ID;
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID
MOVE LOB... (16 Replies)
Discussion started by: rajan_san
16 Replies
5. Shell Programming and Scripting
Hi folks,
I have a file which contains several occurences of 2 different patterns. I need to find out the line of first occurence of pattern2 starting after the position of first occurence of pattern1.
example file:
aaaa
pattern2
bbbb
pattern1
ccc
pattern2
ddd
pattern1
eee
pattern2... (9 Replies)
Discussion started by: sameucho
9 Replies
6. Shell Programming and Scripting
Hi all!
How can I delete all the text starting from <string1> to <string2> in all the .txt files of the folder "FOLDER" ?
Thanks a lot!
mjomba
...
</s>
<s>
<w></w>
</s>
<s>
...
to get: (1 Reply)
Discussion started by: mjomba
1 Replies
7. Shell Programming and Scripting
Hello, I'm looking for sed solution to change
...
<li>keyword</li>
<li>keyword
<li>keyword</li>
<li>keyword
<li>keyword</li>
...
to
...
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
<li>keyword</li>
...
I.e., if lines beginning with <li> do not end with... (3 Replies)
Discussion started by: pioavi
3 Replies
8. Shell Programming and Scripting
Hi
I need to delete lines from a file which are after pattern1 and between pattern 2 and patter3, as below:
aaaaaaaa
bbbbbbbb
pattern1
cdededed
ddededed
pattern2
fefefefe <-----Delete this line
efefefef <-----Delete this line
pattern3
adsffdsd
huaserew
Please can you suggest... (6 Replies)
Discussion started by: vk2012
6 Replies
9. Shell Programming and Scripting
not getting anywhere with this
an xml file contains multiple clients set up with same tags, different values.
I need to parse the file for client foo, and change the value of tag "64bit" from false to true.
cat clients.xml
<Client type"FIX">
<ClientName>foo</ClientName>... (3 Replies)
Discussion started by: jack.bauer
3 Replies
10. Shell Programming and Scripting
Version: RHEL 6.5
In the below text file, I want to find the lines which has the string JOHN , KATE and STEVE in it.
The logic is to grep with an AND condition ie. get all lines with JOHN AND KATE AND STEVE
$ cat sometext.txt
PHILIP worked in HR
JOHN along with KATE fixed several IT... (4 Replies)
Discussion started by: John K
4 Replies
LEARN ABOUT DEBIAN
zita-a2j
ZITA-REV1(1) General Commands Manual ZITA-REV1(1)
NAME
zita-a2j - Use ALSA playback device as a Jack client, with resampling.
SYNOPSIS
zita-a2j [options]
DESCRIPTION
This tool allows to use an ALSA device as a Jack client, to provide additional playback channels. Functionally it is equivalent to alsa_in
that comes with Jack, but provides much better audio quality.
The resampling ratio will typically be stable within 1 PPM and change only very smoothly. Delay will be stable as well even under worse
case conditions, e.g. the Jack client running near the end of the cycle.
The alsa device should be a 'hw:' one, i.e. direct access to a soundcard and not an ALSA 'plug' device. A well-working Jack system is
assumed, running in real-time mode.
The sample rate can be the same as Jack's one, or different. Minimum delay is obtained by running the alsa device at a lower period size
than Jack. This can be done safely as the alsa thread will run at a higher priority, and apart from copying to/from an internal buffer no
work is done there. There are no restrictions on the product of period_size and number_of_periods as there are for alsa_in and alsa_out.
zita-a2j will optionally print some information four times per second. The first number is the average loop error over the last quarter
second, in samples. It should be reduced to small randowm values close to zero after 15 seconds or so. The second is the dynamic correction
factor of the nominal resampling ratio. This should converge to a value close to one and not move much.
You may observe small variations in these numbers when Jack apps are started or stopped. This is normal. Anything else isn't - please
report.
When starting, and in case of major trouble, you will see the
'Starting synchronisation' message. This can happen if there is a timeout on the Jack server, e.g. a client crashed or terminated in a
dirty way. Jack1 will skip one or more cycles when new apps are started, or when a large number of port connections is done in a short
time. his may interrupt the audio signal, but should otherwise not have any ill consequences nor require a restart.
zita-a2j and zita-j2a will suspend operation while Jack is in
'freewheeling' mode.
OPTIONS
-h Display this text
-d <device>
ALSA capture device [none]
-r <rate>
Sample rate [48000]
-p <period>
Period size [256]
-n <nfrags>
Number of fragments [2]
-c <nchannels>
Number of channels [2]
-Q <quality>
Resampling quality [48]
-v Print tracing information [off]
Use '-h' to see all options.
SEE ALSO
A quick guide is available at <http://kokkinizita.linuxaudio.org/linuxaudio/zita-rev1-doc/quickguide.html>
AUTHOR
zita-ajbridge was written by Fons Adriaensen <fons@linuxaudio.org>.
This manual page was written by Robin Gareus <robin@gareus.org> for the Debian project (but may be used by others). It is based on the
original README and announce message by Fons Adriaensen.
March 2012 ZITA-REV1(1)