selecting each paragraph and put it into a file...help me


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting selecting each paragraph and put it into a file...help me
# 1  
Old 10-04-2005
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
# 2  
Old 10-04-2005
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
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"?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Join Lines every paragraph in a file.txt

Hi all, Is there any idea on how to automate convert the paragraph in one line in a file, this will happen after OCR the documents, OCR split every paragraph. I need to join all the paragraph in one line. #cat file.txtThe Commission on Higher Education (CHED) was created through Republic Act... (7 Replies)
Discussion started by: lxdorney
7 Replies

2. Shell Programming and Scripting

Retrieving a paragraph from a pdf file using shell commands

In the reference section of a research paper(in pdf form), many other paper names are cited which have been used inside the pdf at different places. If I give an input, the name of a paper which has been cited in the reference section and want to display the section (the paragraph) inside the pdf... (1 Reply)
Discussion started by: SK33
1 Replies

3. Shell Programming and Scripting

Read paragraph from file

Hi, I have a file containing SQL commands in following format. I need to run the SQLs separately and also print the status of SQL, successful/unsuccessful. File : SQL.dat ## SQL1 select * from dual; ## SQL2 select user from dual10; Expected output: SQL1:PASS SQL2:FAIL Started... (3 Replies)
Discussion started by: bhupinder08
3 Replies

4. Shell Programming and Scripting

List the file names available on FTP server before selecting the required file

Below is my script code.which shows the environment name and then fetch the file from the ftp server but I am facing one issue.The script should be run in both way.We can pass the arguments with script and select the environment name then file name.Here the issue is I am not able to list the files... (1 Reply)
Discussion started by: anuragpgtgerman
1 Replies

5. Shell Programming and Scripting

Print each paragraph in a text file into excel file

Hi, I have a below text file, which needs to be printed into attached excel file. Please help me. Thanks (4 Replies)
Discussion started by: prash358
4 Replies

6. Shell Programming and Scripting

Easy way to pull a paragraph from a text file?

I have a collection of text files that comprise a mailing list archive. I grep them to find an email that interests me, then open the file in a text editor to find the surrounding paragraph of text. Is there an easy way to do this from the shell instead? (2 Replies)
Discussion started by: CRGreathouse
2 Replies

7. Shell Programming and Scripting

How to search for multiple lines and put them into one paragraph?

Dear all, I'm trying to manipulate a data file and putting a certain lines into one paragraph. What am I actually want to do is that search some lines in a data file. These lines begin with "1\1\GINC-" and end with "\\@" or the following two empty lines as shown in blue. A part of the text... (11 Replies)
Discussion started by: liuzhencc
11 Replies

8. UNIX for Dummies Questions & Answers

Output text from 1st paragraph in file w/ a specific string through last paragraph of file w/ string

Hi, I'm trying to output all text from the first paragraph in a file that contains a specific string through the last paragraph in that file that contains that string. Previously, I was outputting just each paragraph with that search string with: cat in_file | nawk '{RS=""; FS="\n";... (2 Replies)
Discussion started by: carpenn
2 Replies

9. Shell Programming and Scripting

Selecting one file from a list

Hi, I am able to do this by brute force but I am just curious if there is a better way of handling things. Basically the scenario is something like this: There are a number of files in a directory: rib.20071224.1759.gz 24-Dec-2007 17:59 132K rib.20071224.1959.gz 24-Dec-2007... (7 Replies)
Discussion started by: Legend986
7 Replies

10. Shell Programming and Scripting

Replacing a paragraph between pattern , with the content 4m another file

hi, i wanted to put the output of file f1 into the pattern space of file f2 f1: wjwjwjwjwjwjwj //these line go in file f2 jwjwjwjwjwjjwjw wjwjwjwjjwjwjwj f2: Pattern_start __________ //these are the line to be replaced __________ Pattern_end i m... (4 Replies)
Discussion started by: go4desperado
4 Replies
Login or Register to Ask a Question