Please HELP me find a solution

Please HELP me find a solution

Post by ianmoltk » Wed, 20 Oct 1999 04:00:00



I have this file

...
item1 xxx
item1 xxx          
# SameItem Group1 #####################################
item1 xxx
item1 xxx
item1 xxx
item1 xxx
item1 xxx
item1 xxx
item1 xxx
item1 xxx
# SameItem Group2 #####################################
item1 xxx
item1 xxx
item1 xxx
item1 xxx
....

I would like to get all xxx from Group1 to Group2 and stop
the processing.

Would really appreciate any simple solution in ksh,please.

Ian Moltke


--
Posted via Talkway - http://www.talkway.com
Exchange ideas on practically anything (tm).

 
 
 

Please HELP me find a solution

Post by Barry Margoli » Wed, 20 Oct 1999 04:00:00




>I have this file

>...
>item1 xxx
>item1 xxx          
># SameItem Group1 #####################################
>item1 xxx
>item1 xxx
>item1 xxx
>item1 xxx
>item1 xxx
>item1 xxx
>item1 xxx
>item1 xxx
># SameItem Group2 #####################################
>item1 xxx
>item1 xxx
>item1 xxx
>item1 xxx
>....

>I would like to get all xxx from Group1 to Group2 and stop
>the processing.

sed -n '/Group1/,/Group2/p' filename | grep -v SameItem
awk '/Group1/ {printit=1}
     /Group2/ {printit=0}
     /^item1/ {if (printit) {print}}' filename

The sed solution seems so obvious, I wonder how hard you really tried to
come up with this before resorting to the net.  If this comment offends
you, too bad; you got free consulting, but there's no such thing as a free
lunch.

Also, please try to come up with more descriptive Subject lines.  "Help me
find a solution" describes 90% of the postings to this group, don't you
think?

--

GTE Internetworking, Powered by BBN, Burlington, MA
*** DON'T SEND TECHNICAL QUESTIONS DIRECTLY TO ME, post them to newsgroups.
Please DON'T copy followups to me -- I'll assume it wasn't posted to the group.

 
 
 

1. PLEASE Can Any body HAVE SOLUTION using shell Script and awk???????Please

Can anyone have solution to the following problem>???????

Aim: To write mypine, a simple mail client which will read a mailbox
and will allow you to read mails.

Details:

Process a mailbox to create a table of contents and separate the text
corresponding to the body of each mail.

    * The table of contents should have the following information :
From, To, Date, and Subject. Each entry in the table should be assigned
a unique serial number.

    * The text corresponding to the body of a mail should be stored as
a separate gzipped file in a directory called MYMAIL in your home
directory. You can use a suitable naming convention to map the serial
number of a mail to the file storing its text.

    * Your program should take the name of the mail file on command
line and produce (on standard output) a screenful of table of contents.

          o The user should be able to navigate up and down in the
table of contents by giving options for Show Next Page and Show
Previous Page.
          o User should be able to see a particular mail by keying in
its serial number. (This number should be restricted to the numbers
currently displayed on the screen.) When the user selects this option,
your program should display the body of the text (a screenful, at a
time) with navitation facilities Show Next Page and Show Previous Page.
The third option should be to Return to table of contents.
          o The last option should be Quit.

Guidelines:

    * Pre-processing of mailbox to extract information like table of
contents and message body is to be done using awk.
    * Navigation screen to be done using shell scripting with out awk.
    * Your program should be able to cache intelligently, i.e. if the
same mailbox is given for processing again then it should be detected
and the pre-processing part should be skipped and program should
directly move to navigation screen.
    * You are supposed to use shell scripting capabilites and try to
avoid storing data/text extensively in local variables.

2. Browsers and HTTP versions

3. Help in finding an all Redhat solution|Software and Manuals

4. Which Distribution 12/200?

5. need help finding router solution

6. Miro Magic Premium

7. Help needed finding a solution (REPOSTED)

8. Another tar problem

9. Help finding a printing solution!

10. XFLOW PROBLEM: HELP!!! ------SOLUTION FOUND!

11. Sendmail problems. Please please please please help!

12. pppoatm with a 2.4.7 kernel solution?Please help.

13. please help with a solution to cgi problem.