Avatar of s_hausen
s_hausen
 asked on

generate report from log file

i have a log file and the only thing i need from it to generate a report is: discharge date & reason for discharge. the each block starts with sentence
Log-Date: mm/dd/yyyy.

in situation A, the result would be:
Discharge Date: 10/15/2012
Reason: Discharged to home or self-care (routine discharge).

and in situation B, the result would be:
Discharge Date: 10/15/2013
Reason: Discharged to home or self-care (routine discharge).
Discharge Date: 09/15/2012
Reason: Discharged to hospital.

situation A
Log-Date: 10/26/2012. Patient's record created. Admission Date: 08/01/2012   Log-Date: 06/20/2013 Patient Discharged. Discharge Date:10/15/2012 Reason for Discharge:01 - Discharged to home or self-care (routine discharge).  Log-Date: 06/20/2013 Discharge Undone. Discharge Date:11/15/2012. Original Admission Date: 08/01/2012

Open in new window


situation B
Log-Date: 10/26/2013. Patient's record created. Admission Date: 08/01/2013   Log-Date: 06/20/2013 Patient Discharged. Discharge Date:10/15/2013 Reason for Discharge:01 - Discharged to home or self-care (routine discharge).  Log-Date: 06/20/2013 Discharge Undone. Discharge Date:10/15/2013. Original Admission Date: 08/01/2013 Log-Date: 
02/26/2013. Patient's record created. Admission Date: 03/01/2013   Log-Date: 04/20/2013 Patient Discharged. Discharge Date:09/15/2012 Reason for Discharge:03 - Discharged to hospital. 

Open in new window


any help, comment or feedback would be deeply appreciated.
ColdFusion Language

Avatar of undefined
Last Comment
s_hausen

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Terry Woods

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Terry Woods

The pattern appears to pass testing here: http://www.myregextester.com/?r=e699fbe3
s_hausen

ASKER
helped me to solve the problem.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes