12-06-2008
Sed Help.To Search Between Pattern1 And Pattern2 Containing Certain Text
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 (MESSAGE)
STORE AS (
TABLESPACE CLEAN_DATA1
STORAGE (
INITIAL 256K
NEXT 1384K
MINEXTENTS 1
MAXEXTENTS 505
PCTINCREASE 1
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
));
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID
MODIFY LOB (MESSAGE)
(
PCTVERSION 10
);
REVOKE EXECUTE ON DQZ.DQZ_FORMS_VALIDATEX FROM CLEANDATAVNDR;
REVOKE EXECUTE ON DQZ.DQZ_FORMS_REQUIREDX FROM CLEANDATAVNDR;
REVOKE EXECUTE ON DQZ.DQZ_FORMS_DEFAULTSX FROM CLEANDATAVNDR;
REVOKE EXECUTE ON DQZ.DQZ_FORMS_ALLOWEDX FROM CLEANDATAVNDR;
REVOKE EXECUTE ON DQZ.DQZ_FORMS_VALIDATEX FROM SECURITY_MASTER_RL;
REVOKE EXECUTE ON DQZ.DQZ_FORMS_REQUIREDX FROM SECURITY_MASTER_RL;
REVOKE EXECUTE ON DQZ.DQZ_FORMS_DEFAULTSX FROM SECURITY_MASTER_RL;
REVOKE EXECUTE ON DQZ.DQZ_FORMS_ALLOWEDX FROM SECURITY_MASTER_RL;
CREATE OR REPLACE TYPE DQZ."DQZ_SECURITY_OBJECT_CDS" as object (
BUS_DAYS_CNV varchar2(25),
SIP CHAR(8),
ISIN varchar2(12),
ACCRU_MONTH_DAY_COUNT varchar2(8),
ACCRU_YEAR_DAY_COUNT varchar2(8),
MAT_DT DATE,
DATED_DT DATE,
CPN_RT NUMBER,
OID_DT DATE,
CCODE varchar2(3),
EFF_DT DATE,
PMT_FREQ_CD varchar2(2))
/
End Of File
Here is my pattern filter 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 "
From the above file here is what i want to select
Expected Output
ALTER TABLE DQZ.DQZ_ALTER_SCHEMA_ID
MOVE LOB (MESSAGE)
STORE AS (
TABLESPACE CLEAN_DATA1
STORAGE (
INITIAL 256K
NEXT 1384K
MINEXTENTS 1
MAXEXTENTS 505
PCTINCREASE 1
FREELISTS 1
FREELIST GROUPS 1
BUFFER_POOL DEFAULT
));
I do not mind a either a sed or an awk syntax to acheive this.Need this very urgently friends any quick response is very appreciated.
Thanks And Kind Regards,
Rajan.S
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,
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 (2 Replies)
Discussion started by: salih81
2 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 CENTOS
platform::shell
platform::shell(n) Tcl Bundled Packages platform::shell(n)
__________________________________________________________________________________________________________________________________________________
NAME
platform::shell - System identification support code and utilities
SYNOPSIS
package require platform::shell ?1.1.4?
platform::shell::generic shell
platform::shell::identify shell
platform::shell::platform shell
_________________________________________________________________
DESCRIPTION
The platform::shell package provides several utility commands useful for the identification of the architecture of a specific Tcl shell.
This package allows the identification of the architecture of a specific Tcl shell different from the shell running the package. The only
requirement is that the other shell (identified by its path), is actually executable on the current machine.
While for most platform this means that the architecture of the interrogated shell is identical to the architecture of the running shell
this is not generally true. A counter example are all platforms which have 32 and 64 bit variants and where a 64bit system is able to run
32bit code. For these running and interrogated shell may have different 32/64 bit settings and thus different identifiers.
For applications like a code repository it is important to identify the architecture of the shell which will actually run the installed
packages, versus the architecture of the shell running the repository software.
COMMANDS
platform::shell::identify shell
This command does the same identification as platform::identify, for the specified Tcl shell, in contrast to the running shell.
platform::shell::generic shell
This command does the same identification as platform::generic, for the specified Tcl shell, in contrast to the running shell.
platform::shell::platform shell
This command returns the contents of tcl_platform(platform) for the specified Tcl shell.
KEYWORDS
operating system, cpu architecture, platform, architecture
platform::shell 1.1.4 platform::shell(n)