Sponsored Content
Top Forums UNIX for Dummies Questions & Answers print the line immediately after a regexp; but regexp is a sentence Post 302257670 by dennis.jacob on Wednesday 12th of November 2008 09:54:08 PM
Old 11-12-2008
Try:
Code:
sed -n '/Thu Nov 13 /{n;p;}'  filename

Output:

Quote:
alter database mount standby database
ALTER DATABASE RECOVER standby database
ALTER DATABASE RECOVER CONTINUE DEFAULT
Media Recovery Log /oracle/P03/oraarch/P03arch1_7314.dbf
ORA-279 signalled during: ALTER DATABASE RECOVER CONTINUE DEFAULT ...
ALTER DATABASE RECOVER CONTINUE DEFAULT
Media Recovery Log /oracle/P03/oraarch/P03arch1_7315.dbf
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

regexp to get first line of string

Hi everybody for file in * #Bash performs filename expansion #+ on expressions that globbing recognizes. do output="`grep -n "$1" "$file"`" echo "$file: `expr "$output" : '\(^.*$\)'`" done In the above bash script segment, I try to print just the first line of string named... (3 Replies)
Discussion started by: jonas.gabriel
3 Replies

2. Shell Programming and Scripting

regexp to print after a field seperator

Hi, How do i Print anything after a ':' Ex : file1: 1235131(rs32553) I want to print out "1235131(rs32553)" how do i do it. I know we can do this using awk but looking for the right syntax. Any help appreciated. Thanks, Ram (7 Replies)
Discussion started by: ramky79
7 Replies

3. Shell Programming and Scripting

print 2 lines above regexp

I am on a Solaris 10 x86 system sample code before3 before2 before1 group after1 after2 after3 I want to grab the second line above my regexp regexp=group I want to grab ONLY the before2 line I have numerous sed and awk ways of grabbing X line below the regexp, but no luck... (1 Reply)
Discussion started by: snoman1
1 Replies

4. Shell Programming and Scripting

print lines AFTER lines cointaining a regexp (or print every first and fourth line)

Hi all, This should be very easy but I can't figure it out... I have a file that looks like this: @SRR057408.1 FW8Y5CK02R652T length=34 AGCAGTGGTATCAACGCAGAGTAAGCAGTGGTAT +SRR057408.1 FW8Y5CK02R652T length=34 FIIHFF6666?=:88@@@BBD:::?@ABBAAA>8 @SRR057408.2 FW8Y5CK02TBMHV length=52... (1 Reply)
Discussion started by: kmkocot
1 Replies

5. Shell Programming and Scripting

Print lines between a regExp & a blank line

Hi, I have a file, say files_list, as below (o/p of ls -R cmd) $ cat files_list /remote/dir/path/to/file: sub-dir1 sub-dir2 sub-dir3 ... /remote/dir/path/to/file/sub-dir1: remote_file1.csv.tgz <blank line 1> /remote/dir/path/to/file/sub-dir2: remote_file2.csv.tgz <blank... (3 Replies)
Discussion started by: dips_ag
3 Replies

6. Shell Programming and Scripting

awk, sed or perl regexp to print values from file

Hello all According to the following file (orignal one contains 200x times the same structure...) I was wondering if someone could help me to print <byte>??</byte> values example, running this script/command like ./script.sh xxapp I would expect as output: 102 116 112 ./script.sh xxapp2... (2 Replies)
Discussion started by: cabrao
2 Replies

7. Shell Programming and Scripting

sed print first line before regexp and all lines after

Hi All I'm trying to extract the line just above a regexp and all lines after this. I'm currently doing this in two steps sed -n -e "/^+---/{g;p;}" -e h oldfile.txt > modified.txt sed -e "1,/^+---/d" -e "/^$/d" oldfile.txt >>modified.txt Sample sometext will be here sometext will be... (3 Replies)
Discussion started by: Celvin VK
3 Replies

8. Shell Programming and Scripting

Print 4th line back from regexp

I'm looking for a way to print the 4th line back from a regular expression. Kind of like the below but it has to be the 4th line before the regexp. Print the line immediately before regexp, but not the line containing the regexp. sed -n '/regexp/{g;1!p;};h' here is an example of logs(i... (11 Replies)
Discussion started by: senormarquez
11 Replies

9. Shell Programming and Scripting

awk regexp to print repetitive pattern

How to use regexp to print out repetitive pattern in awk? $ awk '{print $0, "-\t-\t-\t-\t-\t-\t-\t-\t-\t-\t-\t-"}' output: - - - - - - - - - - - -I tried following which does not give what I want, of course. awk '{print $0, "-\t{11}-"}' output: - ... (10 Replies)
Discussion started by: yifangt
10 Replies

10. UNIX for Beginners Questions & Answers

awk or sed to print the character from the previous line after the regexp match

Hi All, I need to print the characters in the previous line just before the regular expression match Please have a look at the input file as attached I need to match the regular expression ^ with the character of the previous like and also the pin numbers and the output file should be like... (6 Replies)
Discussion started by: kshitij
6 Replies
ALTER 
VIEW(7) SQL Commands ALTER VIEW(7) NAME
ALTER VIEW - change the definition of a view SYNOPSIS
ALTER VIEW name ALTER [ COLUMN ] column SET DEFAULT expression ALTER VIEW name ALTER [ COLUMN ] column DROP DEFAULT ALTER VIEW name OWNER TO new_owner ALTER VIEW name RENAME TO new_name ALTER VIEW name SET SCHEMA new_schema DESCRIPTION
ALTER VIEW changes various auxiliary properties of a view. (If you want to modify the view's defining query, use CREATE OR REPLACE VIEW.) You must own the view to use ALTER VIEW. To change a view's schema, you must also have CREATE privilege on the new schema. To alter the owner, you must also be a direct or indirect member of the new owning role, and that role must have CREATE privilege on the view's schema. (These restrictions enforce that altering the owner doesn't do anything you couldn't do by dropping and recreating the view. However, a superuser can alter ownership of any view anyway.) PARAMETERS
name The name (optionally schema-qualified) of an existing view. SET/DROP DEFAULT These forms set or remove the default value for a column. A default value associated with a view column is inserted into INSERT statements on the view before the view's ON INSERT rule is applied, if the INSERT does not specify a value for the column. new_owner The user name of the new owner of the view. new_name The new name for the view. new_schema The new schema for the view. NOTES
For historical reasons, ALTER TABLE can be used with views too; but the only variants of ALTER TABLE that are allowed with views are equiv- alent to the ones shown above. EXAMPLES
To rename the view foo to bar: ALTER VIEW foo RENAME TO bar; COMPATIBILITY
ALTER VIEW is a PostgreSQL extension of the SQL standard. SEE ALSO
CREATE VIEW [create_view(7)], DROP VIEW [drop_view(7)] SQL - Language Statements 2010-05-14 ALTER VIEW(7)
All times are GMT -4. The time now is 05:30 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy