•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 391,573 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,817 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser:
Views: 382 | Replies: 3
![]() |
•
•
Join Date: Jul 2008
Posts: 2
Reputation:
Rep Power: 0
Solved Threads: 0
Hi ALL,
I want to print some lines from file like
example
=====
RECOVER DATABASE
ALTER DATABASE OPEN;
ALTER TABLESPACE TEMP ADD
ALTER TABLESPACE TEMP ADD STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE
-- SET STANDBY TO MAXIMIZE PERFORMANCE
MAXLOGFILES 16
MAXLOGMEMBERS 5
MAXDATAFILES 512
MAXINSTANCES 1
MAXLOGHISTORY 7260
LOGFILE
I want to print the lines from "ALTER TABLESPACE TEMP ADD " to till "MAXINSTANCES 1"
Pleas help me in this
Thanks
Jack
I want to print some lines from file like
example
=====
RECOVER DATABASE
ALTER DATABASE OPEN;
ALTER TABLESPACE TEMP ADD
ALTER TABLESPACE TEMP ADD STARTUP NOMOUNT
CREATE CONTROLFILE REUSE DATABASE
-- SET STANDBY TO MAXIMIZE PERFORMANCE
MAXLOGFILES 16
MAXLOGMEMBERS 5
MAXDATAFILES 512
MAXINSTANCES 1
MAXLOGHISTORY 7260
LOGFILE
I want to print the lines from "ALTER TABLESPACE TEMP ADD " to till "MAXINSTANCES 1"
Pleas help me in this
Thanks
Jack
awk '/ALTER TABLESPACE TEMP ADD/,/MAXINSTANCES 1/' file.txt
Or something like it.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
Do not PM me for help; You'll be ignored, or told to learn to read.
Do not ask me if I'm muslim - I'm not. Nor do I care about yours or anyone else's mysticism. Religion is a matrix, take the RED PILL.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Shell Scripting Marketplace
Similar Threads
- Newbie: problems deleting lines from text file (large) (Python)
- Encrypt File using User Supplied Password (VB.NET)
- Beginner working with tab-delimited text file (Perl)
- Is it possible to arange lines in a file alphabetically? (C)
- Quick Reference for Linux Commands (Getting Started and Choosing a Distro)
- Searching a file for a string (C++)
- problem with incrementing numbers in a file (Perl)
- Text File Input and manipulation (C++)
Other Threads in the Shell Scripting Forum
- Previous Thread: Bash Scripting vs AWK GAWK
- Next Thread: Asked by KEANE india in interview



Linear Mode