Results 1 to 3 of 3
Gurus,
My input file has the format as below:
some text
some text
some text
Applications:
------------- some text -----------------------
Transactions:
------------- some text -----------------------
BufferPools:
------------- some text -----------------------
...
- 04-02-2008 #1Just Joined!
- Join Date
- Mar 2008
- Posts
- 5
how to put the text between two key words into a file
Gurus,
My input file has the format as below:
some text
some text
some text
Applications:
------------- some text -----------------------
Transactions:
------------- some text -----------------------
BufferPools:
------------- some text -----------------------
Logs:
------------- some text -----------------------
Locks:
------------- some text -----------------------
Tablespace Configuration:
------------- some text --------------------------
Tablespace Statistics:
------------- some text --------------------------
Tablespace Autoresize Statistics:
------------- some text --------------------------
Containers:
------------- some text --------------------------
Dynamic Cache:
------------- some text --------------------------
Dynamic SQL Statements:
------------- some text --------------------------
Dynamic SQL Environments:
------------- some text --------------------------
Dynamic SQL Variations:
------------- some text --------------------------
I would like to split this file into multiple parts. For example, I need the text between "Locks:" and "Tablespace Configuration:" in one file. How do I do this ?
To be more clear, I need the "locksfile" to start with "Locks:" and put the text (into locksfile) following "Locks:" key word till it encouters the next key word like "Tablespace Configuration:".
Thanks a lot.
- 04-02-2008 #2
Some pseudocode:
Does this make sense?Code:while there are lines to read, do: line := readLine() if isKeyword(line), then: closeCurrentlyOpenFile() file := openFileForKeyword(line) printToFile(file, line) else: printToFile(file, line)DISTRO=Arch
Registered Linux User #388732
- 04-03-2008 #3Just Joined!
- Join Date
- Mar 2008
- Posts
- 26


Reply With Quote
