Advertisement

05.29.2008 at 09:21PM PDT, ID: 23443627
[x]
Attachment Details

Split Text File-Perl/Unix Script

Asked by mkhan900 in Perl Programming Language, Unix Operating Systems

I am a complete nowise and would greatly appreciate help with a script.

I have a file which needs to be split into multiple file based on the error code. Each record begins with

REPORT: RESP       FRONT SYSTEM
and end with
END OF REPORT
between these line is some errorcd.
If the program is provided with the following text in the parameter file it should create 2 different files for
every errorcd not creating a file for the once which don't have any error.

REPORT: RESP       FRONT SYSTEM
RUN DATE: 20080529            REPORT

RECORD  SEQ     ERROR
 TYPE   NO      CODE    ERROR DESCRIPTION
  BHD  0018586  132 NOT AUTHORIZED.
  BHD  0019529  132 NOT AUTHORIZED.
  BHD  0019529  235 NOT VALID. (This line should not appear on the new file since the seq_no for the previous is same)
 END OF REPORT
SUBMITTER ID: DEVON
FILE ID: 407       REJECTED  PROD
 
RECORD  SEQ     ERROR
 TYPE   NO      CODE    ERROR DESCRIPTION
 END OF REPORT

Thanks for the help in advance


Start Free Trial
[+][-]05.29.2008 at 10:13PM PDT, ID: 21675382

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 05:03AM PDT, ID: 21676909

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 07:06AM PDT, ID: 21677839

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 07:33AM PDT, ID: 21678092

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 07:35AM PDT, ID: 21678114

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 08:04AM PDT, ID: 21678434

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 08:08AM PDT, ID: 21678480

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 08:15AM PDT, ID: 21678546

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 08:16AM PDT, ID: 21678556

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 08:23AM PDT, ID: 21678626

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 09:05AM PDT, ID: 21679058

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]05.30.2008 at 09:15AM PDT, ID: 21679141

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Perl Programming Language, Unix Operating Systems
Sign Up Now!
Solution Provided By: ozo
Participating Experts: 2
Solution Grade: A
 
 
[+][-]05.30.2008 at 09:37AM PDT, ID: 21679335

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628