The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with selecting specific lines in a large file tansha UNIX for Dummies Questions & Answers 2 02-06-2008 05:26 AM
Urgent: selecting unique specific content of a file using shell script jisha Shell Programming and Scripting 2 01-08-2008 05:45 AM
Replacing a paragraph between pattern , with the content 4m another file go4desperado Shell Programming and Scripting 4 12-07-2006 06:44 AM
Archiving Files by selecting years file created dmhammond UNIX for Dummies Questions & Answers 2 06-13-2005 11:12 AM
Selecting records from file on criteria. videsh77 Shell Programming and Scripting 7 12-29-2004 11:20 AM

Closed Thread
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 10-04-2005
Registered User
 

Join Date: Sep 2005
Posts: 25
selecting each paragraph and put it into a file...help me

Dear Friends,
I need a shell script.
I am facing a problem while selecting the text that is between start and end tags. and insert the paragraph into a file1, next paragraph in file2......
experts please help.

i have a file which contains,
--------------
<abc> 111some text some text
some text some text
some text some text
some text some text
some text </abc>
===blank line======
<abc>222 some text some text
some text some text
some text some text
some text some text
some text </abc>
===blank line======
<abc> 333some text some text
some text some text
some text some text
some text some text
some text </abc>
-------------------------------

I want to get the text that started with <abc> and end with </abc> and put it into a file.
i.e.,

file1 should contain following text,
<abc>111 some text some text
some text some text
some text some text
some text some text
some text </abc>

file2 should contain following text,
<abc>222 some text some text
some text some text
some text some text
some text some text
some text </abc>

and

file3 should contain following text,
<abc>333 some text some text
some text some text
some text some text
some text some text
some text </abc>

it will be a great help if any one can gives the solution.

Thanks in Advance,
Narayanaswamy M
Forum Sponsor
  #2  
Old 10-04-2005
Registered User
 

Join Date: Sep 2005
Posts: 25
vary urgent please help me....please

Dear Friends,
I need a shell script.
I am facing a problem while selecting the text that is between start and end tags. and insert the paragraph into a file1, next paragraph in file2......
experts please help.

i have a file which contains,
--------------
<abc> 111some text some text
some text some text
some text some text
some text some text
some text </abc>
===blank line======
<abc>222 some text some text
some text some text
some text some text
some text some text
some text </abc>
===blank line======
<abc> 333some text some text
some text some text
some text some text
some text some text
some text </abc>
-------------------------------

I want to get the text that started with <abc> and end with </abc> and put it into a file.
i.e.,

file1 should contain following text,
<abc>111 some text some text
some text some text
some text some text
some text some text
some text </abc>

file2 should contain following text,
<abc>222 some text some text
some text some text
some text some text
some text some text
some text </abc>

and

file3 should contain following text,
<abc>333 some text some text
some text some text
some text some text
some text some text
some text </abc>

it will be a great help if any one can gives the solution.

Thanks in Advance,
Narayanaswamy M
  #3  
Old 10-04-2005
Registered User
 

Join Date: Jan 2005
Posts: 682
You have already been given the advice in this thread
  1. The rules state that you aren't to bump up your questions in order to get an answer more quickly. You keep doing this and have indicated that you have read the rules completely.
  2. You were already given advice and you aren't likely to get any closer to solving your "urgent" problem until you work with the advice that you were already given. What was your conclusion from reading the man page for "awk"?
Google The UNIX and Linux Forums
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:36 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0