Sponsored Content
Top Forums Shell Programming and Scripting Capture lines based on keywords Post 88324 by futurelet on Thursday 3rd of November 2005 12:13:10 AM
Old 11-03-2005
Code:
awk '/keyword1.*keyword2/, /keyword3/' infile

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to keep appending a newly created file based on some keywords

Hi Friends, I have to create a new log file everyday and append it with content based on some keywords found in another log file. Here is what I have tried so far... grep Error /parentfolder/someLogFile.log >> /parentfolder /Archive/"testlogfile_error_`date '+%d%m%y'`.txt" grep error... (6 Replies)
Discussion started by: supreet
6 Replies

2. Shell Programming and Scripting

How to search for keywords in subsequent lines

Hi all, I am looking for a coomand to search for the keywords in susequenct lines. Keyword1 in a line and Keyword2 in the very next line. Once i found the combination ineed to print the lines with patterns and the line above and one below. I am giving an example here: Keywords are :ERROR and... (12 Replies)
Discussion started by: rdhanek
12 Replies

3. UNIX for Advanced & Expert Users

Forwarding based on keywords in sendmail

I have an application that runs on the server with root privileges and all emails it sends get sent to root (errors, logs, etc), when they should actually go to one of application admins. I would like to separate these emails from the OS related one sent to root and forward them to that... (2 Replies)
Discussion started by: vostrushka
2 Replies

4. Shell Programming and Scripting

Sorting lines based on keywords for MySQL script

the thing which i require is very very complex.. i tried hard to find the solution but couldnt.. the thing i need to achieve is say i have a file cat delta.sql CREATE VIEW Austin Etc etc . . . CREATE VIEW Barabara AS SELECT blah blah blah FROM Austin z, Cluster s, Instance i WHERE... (4 Replies)
Discussion started by: vivek d r
4 Replies

5. Shell Programming and Scripting

copy range of lines in a file based on keywords from another file

Hi Guys, I have the following problem. I have original file (org.txt) that looks like this module v_1(.....) //arbitrary number of text lines endmodule module v_2(....) //arbitrary number of text lines endmodule module v_3(...) //arbitrary number of text lines endmodule module... (6 Replies)
Discussion started by: kaaliakahn
6 Replies

6. Shell Programming and Scripting

Extracting words and lines based on keywords

Hello! I'm trying to process a text file and am stuck at 2 extractions. Hoping someone can help me here: 1. Given a line in a text file and given a keyword, how can I extract the word preceeding the keyword using a shell command/script? For example: Given a keyword "world" in the line: ... (2 Replies)
Discussion started by: seemad
2 Replies

7. Shell Programming and Scripting

Display lines between keywords inclusive

Hi, I have a file that contains a lot of lines that are repetitive. I am interested in grepping the following section which is repetitive. ::::::::::::::::::::::::::::::::::::::: ::::::::::::::::::::::::::::::::::::::: <Address> <Street>xxxy</Street> ... (3 Replies)
Discussion started by: jakSun8
3 Replies

8. Shell Programming and Scripting

awk to print line based on two keywords

I am starting to write a multi-line awk and using the file below which is tab-delimited, print only the line with oncomineGeneClass and oncomineVariantClass and PASS. The script execute but seems to be printing the entire file, not the desired line. Thank you :). file ... (8 Replies)
Discussion started by: cmccabe
8 Replies

9. Shell Programming and Scripting

Split content based on keywords

I need to split the file contents with multiple rows based on patterns Sample: Input: ABC101testXYZ102UKMNO1092testing ABC999testKMNValid Output: ABC101test XYZ102U KMN1092testing ABC999test KMNValid In this ABC , XYZ and KMN are patterns Continue here./mod] Please read forum... (1 Reply)
Discussion started by: Jairaj
1 Replies

10. UNIX for Beginners Questions & Answers

Split content based on keywords

I need to split the file contents with multiple rows based on patterns Sample: Input: ABC101testXYZ102UKMNO1092testing ABC999testKMNValid Output: ABC101test XYZ102U KMN1092testing ABC999test KMNValid In this ABC , XYZ and KMN are patterns (6 Replies)
Discussion started by: Jairaj
6 Replies
sethead(1)						      General Commands Manual							sethead(1)

Name
       sethead - Set FITS or IRAF header keyword values

Synopsis
       sethead [-dknv][r letter] <FITS or IRAF file> kw1=val1 kw2=val2 ... kwn=valuen

Description
       Set parameters in the header of a FITS or IRAF image.  If the keywords do not already exist, they are added at the end of the header.  Val-
       ues are assumed to be numeric if they contain no alphabetic characters and right-aligned.  Otherwise they are left-aligned after the equals
       sign,  and padded by spaces to a minimum of 8 characters.  To set keywords in a list of files, substitute @<listfile> for the file names on
       the command line.  To set a lot of keywords, put them, one per line, in a file and substitute @<keylistfile> on the command line.  If two @
       commands  are  present,	the  program  will figure out which contains file names and which contains keywords.  Lines in a keyword list file
       which do not contain an = are ignored.

Options
       -h     Write HISTORY line into output header with sethead version, current date and time, and names of keywords set.

       -k     Write SETHEAD keyword into output header with sethead version, current date and time, and names of keywords set.	If a SETHEAD  key-
	      word already exists, move the old value to a HISTORY line before writing the new value

       -n     Write a new file with an added "e" before the extension.

       -r letter
	      Rename  existing keywords whose values are being reset by prepending the character "letter".  Drop the last character if the changed
	      keyword is already 8 characters long.

       -v     Print confirmations of each parameter setting

Web Page
       http://tdc-www.harvard.edu/software/wcstools/sethead.html

Author
       Doug Mink, SAO (dmink@cfa.harvard.edu)

6 July 2001							     WCSTools								sethead(1)
All times are GMT -4. The time now is 02:19 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy