Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Display n lines after match found and other line Post 302662153 by jayan_jay on Tuesday 26th of June 2012 08:43:46 AM
Old 06-26-2012
Based on the input file given..
Code:
$ nawk '/InsuredName/ {f=NR; getline; print} NR==f+8' infile
Address1
ClaimNo1
Address1
ClaimNo2

This User Gave Thanks to jayan_jay For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

if match found go to a particular line in perl

Hello Experts, I am newbie to perl, just curious to know how to do the following in perl. suppose I ve a txt file like below. when it founds "*Main Start" Then go to "*Main End,,,,,,,," patteren and just collect the number from the previous line of "*Main End,,,,,,," pattern . In my... (17 Replies)
Discussion started by: user_prady
17 Replies

2. UNIX for Dummies Questions & Answers

Grep and display n lines after the match is found.

Hello, How do I use grep to find a pattern in a list of file and then display 5 lines after the pattern is matched Eg: I want to match the string GetPresentCode in all files in a folder and then see 4 lines following this match. I am not sure if grep is what should be used to achieve. Thanks!... (3 Replies)
Discussion started by: cv_pan
3 Replies

3. UNIX for Dummies Questions & Answers

awk display the match and 2 lines after the match is found.

Hello, can someone help me how to find a word and 2 lines after it and then send the output to another file. For example, here is myfile1.txt. I want to search for "Error" and 2 lines below it and send it to myfile2.txt I tried with grep -A but it's not supported on my system. I tried with awk,... (4 Replies)
Discussion started by: eurouno
4 Replies

4. UNIX for Dummies Questions & Answers

Display n lines before match found

I have a file with following data A B C D E F G H I K L M N and search pattern is G Expected output (3 Replies)
Discussion started by: nsuresh316
3 Replies

5. UNIX for Dummies Questions & Answers

Display lines after match is found within specified range

I have a file which has collection of segments occuring n(For eg.100) times ISA GS ST NM1*85 N3 N4 NM1*IL N3 N4 REF*D9*1001 ISE GE SE ISA GS ST NM1*85 N3 (13 Replies)
Discussion started by: nsuresh316
13 Replies

6. Shell Programming and Scripting

Displaying text till pattern match found in a line

Hi All, From the below line if we want to display all the text till found pattern dot/. I was trying with the below code but couldn't able to print text before the pattern. it display texts which is found after pattern. awk '/assed/{print;getline;print}' file_name | sed 's/^*. *//' input... (4 Replies)
Discussion started by: Optimus81
4 Replies

7. Shell Programming and Scripting

Grep multiple exact match, do not display lines

Hi, Need help to grep the following from a file x. I just want to grep exact match not lines and not partial word. CONFSUCCESS CONFFAIL CONFPARTIALSUCCESS >cat x xczxczxczc zczczcxx CONFSUCCESS czczczcczc czxxczxzxczcczc CONFFAIL xczxczcxcczczc zczczczcz CONFPARTIALSUCCESS czczxcxzc ... (4 Replies)
Discussion started by: rajeshwebspere
4 Replies

8. UNIX for Dummies Questions & Answers

awk - (URGENT!) Print lines sort and move lines if match found

URGENT HELP IS NEEDED!! I am looking to move matching lines (01 - 07) from File1 and 77 tab the matching string from File2, to File3.txt. I am almost done but - Currently, script is not printing lines to File3.txt in order. - Also the matching lines are not moving out of File1.txt ... (1 Reply)
Discussion started by: High-T
1 Replies

9. Shell Programming and Scripting

How to print the entire line if the mentioned match is found?

Hello Everyone, I have a file with 5 fields in each line just like mentioned below. Also the 4th field is time elapsed(hh:mm:ss) since the process is running xyz abc status 23:00:00 idle abc def status 24:00:00 idle def gji status 27:00:02 idle fgh gty status 00:00:00 idle Here I... (8 Replies)
Discussion started by: rahul2662
8 Replies

10. Shell Programming and Scripting

Add comment on last line if found match

Hi All, totally new on it , normally use it for just 1 line. i'm looking for help. i'm have 2 file. file 1 : -------------------------------------------------- c12 c1 c3 -------------------------------------------------- file 2: other content ... (10 Replies)
Discussion started by: kttan
10 Replies
RT::Client::REST::User(3pm)				User Contributed Perl Documentation			       RT::Client::REST::User(3pm)

NAME
RT::Client::REST::User -- user object representation. SYNOPSIS
my $rt = RT::Client::REST->new(server => $ENV{RTSERVER}); my $user = RT::Client::REST::User->new( rt => $rt, id => $id, )->retrieve; DESCRIPTION
RT::Client::REST::User is based on RT::Client::REST::Object. The representation allows one to retrieve, edit, comment on, and create users in RT. Note: RT currently does not allow REST client to search users. ATTRIBUTES
id For retrieval, you can specify either the numeric ID of the user or his username. After the retrieval, however, this attribute will be set to the numeric id. name This is the username of the user. password User's password. Reading it will only give you a bunch of stars (what else would you expect?). privileged Can the user have special rights? disabled Can this user access RT? email_address E-mail address of the user, EmailAddress. real_name Real name of the user, RealName. gecos Gecos. comments Comments about this user. nickname Nickname of this user. lang Language for this user. organization address_one First line of the street address, Address1. address_two Second line of the street address, Address2. city City segment of user's address. zip ZIP or Postal code segment of user's address. country Country segment of user's address. home_phone User's home phone number, HomePhone. work_phone User's work phone number, WorkPhone. cell_phone User's cell phone number, MobilePhone. pager User's pager number, PagerPhone. contactinfo Contact info (Extra Info field). signature Signature for the user. DB METHODS
For full explanation of these, please see "DB METHODS" in RT::Client::REST::Object documentation. retrieve Retrieve RT user from database. store Create or update the user. search Currently RT does not allow REST clients to search users. INTERNAL METHODS
rt_type Returns 'user'. SEE ALSO
RT::Client::REST, RT::Client::REST::Object, RT::Client::REST::SearchResult. AUTHOR
Dmitri Tikhonov <dtikhonov@yahoo.com> LICENSE
Perl license with the exception of RT::Client::REST, which is GPLed. perl v5.14.2 2012-01-20 RT::Client::REST::User(3pm)
All times are GMT -4. The time now is 03:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy