Sponsored Content
Homework and Emergencies Emergency UNIX and Linux Support Find two words and join together in one file Post 302427121 by Scrutinizer on Friday 4th of June 2010 03:15:43 AM
Old 06-04-2010
Hi, this would combine the two criteria:
Code:
awk '/for input record/          {p=""}
     /^Fatal/                    {sub(/\.$/," is id = ");p=$0}
     p&&/^Record/                {print p$17}
     p&&/^search does not exist/ {print p$8}' infile

Output:
Code:
Fatal Error for input record 25 is id = 543523
Fatal Error for input record 35 is id = 643523
Fatal Error for input record 27889 is id = 2396539
Fatal Error for input record 27892 is id = 2396540
Fatal Error for input record 27893 is id = 2396541
Fatal Error for input record 27894 is id = 2396542
Fatal Error for input record 27895 is id = 2396543
Fatal Error for input record 27896 is id = 2396544
Fatal Error for input record 27901 is id = 2396545

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to find capital letter names in a file without finding words at start of sentence

Hi, I want to be able to list all the names in a file which begin with a capital letter, but I don't want it to list words that begin a new sentence. Is there any way round this? Thanks for your help. (1 Reply)
Discussion started by: kev269
1 Replies

2. Shell Programming and Scripting

Script to find all the files that contain any of the words present in another file

Hi All, I am new to UNIX and shell scripts and also new to this forum. I need a script to find all the files in a directory that contain any of the strings present in another file. Please provide me the script or if you could provide pointers to any link in this forum it would be helpful.... (4 Replies)
Discussion started by: tsanthosh
4 Replies

3. Shell Programming and Scripting

Shell script to find out words, replace them and count words

hello, i 'd like your help about a bash script which: 1. finds inside the html file (it is attached with my post) the code number of the Latest Stable Kernel, 2.finds the link which leads to the download location of the Latest Stable Kernel version, (the right link should lead to the file... (3 Replies)
Discussion started by: alex83
3 Replies

4. Shell Programming and Scripting

Splitting Concatenated Words in Input File with Words from a Master File

Hello, I have a complex problem. I have a file in which words have been joined together: Theboy ranslowly I want to be able to correctly split the words using a lookup file in which all the words occur: the boy ran slowly slow put child ly The lookup file which is meant for look up... (21 Replies)
Discussion started by: gimley
21 Replies

5. Shell Programming and Scripting

Splitting concatenated words in input file with words from the same file

Dear all, I am working with names and I have a large file of names in which some words are written together (upto 4 or 5) and their corresponding single forms are also present in the word-list. An example would make this clear annamarie mariechristine johnsmith johnjoseph smith john smith... (8 Replies)
Discussion started by: gimley
8 Replies

6. Shell Programming and Scripting

Find Multiple words in a file

Hi all, I have trouble in finding the multiple word in .txt file. Please help me with any solution. I have 10,000 .txt files and in each file i have to search specific word but more than one, like (data, machine learning, clustering) and all these keywords should be case insensitive because... (3 Replies)
Discussion started by: XXLMMN
3 Replies

7. UNIX for Dummies Questions & Answers

Find a file with common initials and last words

Hi, I have a requirement like i have to find out files and remove them on a daily basis. The files are generated as abc_jnfn_201404230004.csv abc_jnfo_201404230004.csv abc_jnfp_201404230004.csv abc_jnfq_201404230004.csv abd_jnfn_201404220004.csv abe_jnfn_201404220004.csv i want to... (1 Reply)
Discussion started by: Mohammed_Tabish
1 Replies

8. Shell Programming and Scripting

How count the number of two words associated with the two words occurring in the file?

Hi , I need to count the number of errors associated with the two words occurring in the file. It's about counting the occurrences of the word "error" for where is the word "index.js". As such the command should look like. Please kindly help. I was trying: grep "error" log.txt | wc -l (1 Reply)
Discussion started by: jmarx
1 Replies

9. UNIX for Dummies Questions & Answers

Replace the words in the file to the words that user type?

Hello, I would like to change my setting in a file to the setting that user input. For example, by default it is ONBOOT=ON When user key in "YES", it would be ONBOOT=YES -------------- This code only adds in the entire user input, but didn't replace it. How do i go about... (5 Replies)
Discussion started by: malfolozy
5 Replies

10. Shell Programming and Scripting

Replace particular words in file based on if finds another words in that line

Hi All, I need one help to replace particular words in file based on if finds another words in that file . i.e. my self is peter@king. i am staying at north sydney. we all are peter@king. How to replace peter to sham if it finds @king in any line of that file. Please help me... (8 Replies)
Discussion started by: Rajib Podder
8 Replies
ns_log(3aolserver)					    AOLserver Built-In Commands 					ns_log(3aolserver)

__________________________________________________________________________________________________________________________________________________

NAME
ns_log, ns_logctl - commands SYNOPSIS
ns_log severity message _________________________________________________________________ DESCRIPTION
While the AOLserver is running it logs various events from Notices to Fatal errors. Usually the AOLserver is running in the background, in which case these messages are placed in the server log. In absence of an ServerLog key in the AOLserver nsd.ini file, this file is the /log/error.log under the AOLserver installation directory. When the AOLserver is running in the foreground the messages are redirected to stderr. ns_log writes the message to the server error log file. Allowable values for severity are: Notice - Something interesting occurred. Warning - Something that could mean something bad occurred. Error - Something bad occurred. Fatal - Something extremely bad occurred. The server will shut down after logging the message. Bug - Something occurred that implies that there is a bug in the code. Debug - If the server is in Debug mode, the message is printed. Debug mode is specified in the [ns/parameters] section of the configuration file. Otherwise, the message is not printed. SEE ALSO
nsd(1), info(n) KEYWORDS
AOLserver 4.0 ns_log(3aolserver)
All times are GMT -4. The time now is 04:28 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy