Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Hello Friends, I have a file who

Status
Not open for further replies.

MGoel

Programmer
Jan 26, 2002
17
US
Hello Friends,

I have a file whose contents I have to read and is iven below:
==============================
Request Number: 000248
Priority: Medium
Request Area: Accounting
Brief Description:
Add the account number/s to the automatic product verification emails.
Please enter a short description of the
request.
This is related to SR #000230. The account number is a useful information
for our RAPID Users
when they research on what is being requested in the RAPID Product
Receipt Verification email.

Business
Objectives

This is an enhancement of the email text that aims to facilitate getting
responses from our RAPID
users. In turn, RAPID Accounting is able to accomplish more effectively
and efficiently the purpose
of the product verification sampling report in a shorter time possible.

How will it be determined that the business objectives have been
satisfied?
When the turnaround time shows a significant improvement and the number of
responses gets
higher, it means that our business objectives are getting met.

Who will be responsible for performing the
measurements?
RAPID Accounting will be responsible for performing the measurements.

What are the requirements for this
request?

To make this enhancement possible, resource and time allotted by RAPID IT
will be needed.

Describe what benefits will be derived from this
request.
RAPID Accounting business controls will be benefited by this request.
RAPID Users will more likely
respond to the verification request and therefore ensure that any issues
are resolved as quickly as
possible.

===================
I want to read selected data from this file.

for e.g.

Business
Objectives

and then the next one is:
How will it be determined that the business objectives have been
satisfied?

but if you see Business Objectives is in 2 lines.
I want to read data between Business Objectives and
next record which is: How will it be determined that the business objectives have been
satisfied?


The problem is Business Objectives is split in 2 lines.
I tried following code but it gets the pattern line also which i don't want.

#/Objectives/ , /^$/ {next; print}
#/Priority:/ {print $2}
#/satisfied?/ , /^$/ {print}
#/Author/{print $2 " " $3}
#/Creation Date/{print $6}

Please help how can i do this task. This is rather urgent. Please help as soon as possible.

Thanks
 
{ if (mark >1) print; }
/^business/{ mark = 1; next; }
/^Objective/{ if(!mark) next;
mark = 2;
printf("Business\nObjectives\n");
next; }

/^How ..../{ mark = 0; next; } vox clamantis in deserto.
 
Hi Jamisar,

It still quite is not working, I tried your logic and used the following lines of code
{ if (mark >1) print ; }
/Priority:/ {print $2}
#/satisfied?/ , /^$/ {print}

/^Business/{ mark = 1; next; }
/^Objectives/{ if(!mark) next;
mark = 2;
next; }

/^How will it be determined that the business objectives have been /{ mark = 0;next; }
/^satisfied?/{ mark = 2;}

#/^Who will be responsible for performing the /{ mark = 0;next;}
/^measurements?/{ mark = 2;}

/^What are the requirements for this /{ mark = 0;next;}
/^request? /{ mark = 2; } /Author/{print $2 " " $3}
/Creation Date/{print $6}

So the output is
Medium

This is an enhancement of the email text that aims to facilitate getting
responses from our RAPID
users. In turn, RAPID Accounting is able to accomplish more effectively
and efficiently the purpose
of the product verification sampling report in a shorter time possible.

How will it be determined that the business objectives have been
When the turnaround time shows a significant improvement and the number of
responses gets
higher, it means that our business objectives are getting met.

Who will be responsible for performing the
RAPID Accounting will be responsible for performing the measurements.

What are the requirements for this
Bartolome DelCastillo
09/27/2001

so you can see that it still prints the line fo next heading as the mark is not set till that time.

Also I wanted the output to be appended toa string.

Also is there a way to print records from current row till first blank line.

Your help is highly appreciated.

Thanks

Manoj

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top