Find term and extract till end of data


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Find term and extract till end of data
# 1  
Old 04-17-2007
Find term and extract till end of data

Hi All,

I have an awk code below. How can i edit it such that once it finds the term "start" , it will extract all the rest of data thereafter ?

awk '/start/, /stop/' file
# 2  
Old 04-17-2007
Try..
Code:
awk '/start/, 0' file

# 3  
Old 04-17-2007
Code:
sed -n "/start/,$ p" file

# 4  
Old 04-17-2007
Code:
awk '/start/,/NR/' filename

# 5  
Old 04-17-2007
Quote:
Originally Posted by jacoden
Code:
awk '/start/,/NR/' filename

umm... that code would print lines from where the line contains "start" until the line contains "NR".
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pattern match till the end of the file.

I have a file which is like this ……………………………………….. ………………………………… ………………………………… …………………………………… ……………………………………. ……………………………… <<<from_here>>> ……………………………… ………………………………. I want a script which would fetch the data starting from <<<from_here>>> in the file till the end... (2 Replies)
Discussion started by: halfafringe
2 Replies

2. Shell Programming and Scripting

Cut line from file till the end

Hi I have a 57 line text file and I want to cut first 6 line assigned it to a veriable and again cut next 6 line assigned to same variable till the time file have left 0 line. Please let me know how I can do in scripting. Thanks Sanjay (6 Replies)
Discussion started by: Sanjay2121
6 Replies

3. Shell Programming and Scripting

Remove line starting from space till end.

Hi, I have a code tag, from which i have the below snippet: intelrpt.GetCMB_FB type=ODBC> intelrpt.GetCMB_FB type=SYBASE> I want the output like: intelrpt.GetCMB_FB intelrpt.GetCMB_FB That is remove the lines starting from WHITESPACE till end. Please help. I am new to... (7 Replies)
Discussion started by: anupdas
7 Replies

4. Shell Programming and Scripting

Grep from a starting line till the end of the file

Hi Folks, I got to know from this forums on how to grep from a particular line say line 6 awk 'NR==6 {print;exit}' But how do i grep from line 6 till the end of the file or command output. Thanks, (3 Replies)
Discussion started by: Mr. Zer0
3 Replies

5. Shell Programming and Scripting

take all characters from end to start till a fullstop

e.g. "hello.all" to be transformed to "all" :b: (6 Replies)
Discussion started by: hakermania
6 Replies

6. Shell Programming and Scripting

Subsitute from a position till end of line.

Hi, Having a following file's content, lets say: ABC|ANA|LDJ|||||DKD|||||| AJJ|KKDD||KKDK|||||||||||| KKD||KD|||LLLD||||LLD||||| Problem: Need to replace pipes from 8th occurrence of pipe till end. so the result should be: ABC|ANA|LDJ|||||DKD AJJ|KKDD||KKDK|||| ------- ------- ... (12 Replies)
Discussion started by: _Noprofi
12 Replies

7. UNIX for Advanced & Expert Users

Urgent Help required : awk/sed help to find pattern and delete till end of line

Hi, I need help with using an awk or sed filter on the below line ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE Look for... (1 Reply)
Discussion started by: rajan_san
1 Replies

8. Shell Programming and Scripting

Urgent! Sed/Awk Filter Find Pattern Delete Till End Of Line

Hi, I need help with using an awk or sed filter on the below line ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE Look for... (2 Replies)
Discussion started by: rajan_san
2 Replies

9. Shell Programming and Scripting

Anyways to find sentences with data format and extract it???

Hi guys,i got this problem which is..i need to find those sentences with date inside and extract them out,the input is somehow like this eg: $DATA42.GANTRY2.GA161147 DISKFILE 2007-10-16 11:56:45 SUPER.OPR \NETS.$Y4CB.#IN ... (4 Replies)
Discussion started by: cyberray
4 Replies

10. Shell Programming and Scripting

extract data from a find string

Can any one please lend a helping hand here? eg. find /tough -name temp1 -print After finding the location of all temp1 files. I need to extract some data( some are multiple others are just one entry) from each of the temp file. eg Order_Error{"aaaa") Order_Error("bbba") ... (2 Replies)
Discussion started by: odogbolu98
2 Replies
Login or Register to Ask a Question