Multiple search and replace filters (extractions)?

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
Joe

Multiple search and replace filters (extractions)?

Post by Joe »

Not sure I'm going about this the right way and now I'm stuck. I've managed to creat two seperate search and replaces (easy pattern search, and I've tested each independently so I know each finds what i want) but I cant figure out how to get both of these pieces of data out and into the same tab delimited file.

What I have is basically the result of a formmail script submitting a weekly timesheet Near the top I need the employee's name and email address, then further down there are 7 repeating groups of data (7 records, with each field scattered onto it's own line).

I'd like to get this out into one pass to parse this for an excel spreadsheet.
Sample data is below. Names and email headers have been change to protect the innocent.

Any help much appreciated.
Thank you.




X-From_: *snipped* Sat Oct 1 13:44:46 2005
X-Envelope-From: *snipped*
Date: Sat, 1 Oct 2005 13:44:44 -0400
X-Authentication-Warning: web172.megawebservers.com: somedomain.com set sender to postmaster@someotherdomain.net using -f
X-Mailer: NMS FormMail 3.14c1
To: timesheets@somedomain.com
From: somemailer@somedomain.com (yourname here)
Subject: Time Sheet submission form
X-MOR: 0
X-MOP: 0
X-MMX: 0
X-MMC: 227
X-MMR: 0


Below is the result of your feedback form. It was submitted by
Mike Forrester (MikeAndIke@somewhereElse.com) on Saturday, October 01, 2005 at 13:44:44
---------------------------------------------------------------------------
SnailMailAddress: 321a somewhereoranother Street
City: New York
State: NY
zipcode: 10013
DataStartDelimeter: **--**--**
Date1: 01/01/05
TimeIN1: 9:00
TimeOUT1: 5:00 pm
Client Name1: jane
Work Location1: 321
Date2: 02/02/05
TimeIN2: 9:00am
TimeOUT2: 5:00pm
Client Name2: jack
Work Location2: 80cp
Date3: 03/03/05
TimeIN3: 11:00
TimeOUT3: 6:00 pm
Client Name3: jack
Work Location3: 80 cp
Date4: 04/04/05
TimeIN4: 9:00am
TimeOUT4: 5:00 pm
Client Name4: Jane
Work Location4: 321
Date5: 05/05/05
TimeIN5: 9:00 am
TimeOUT5: 5:00 pm
Client Name5: Jack and Jill
Work Location5: 1234 56th street apt. 78
Date6: 06/06/05
TimeIN6: 9:00 am
TimeOUT6: 12:30 pm
Client Name6: Mike and Ike
Work Location6: 2233 44th Street apt 55
Date7: 06/06/05
TimeIN7: 12:30 pm
TimeOUT7: 4:30 pm
Client Name7: Jack and Jill
Work Location7: 1234 56th street apt. 78
DataEndDelimeter: --**--**--
submit: Submit my hours
---------------------------------------------------------------------------
azariatech
Posts: 1
Joined: Sun Oct 02, 2005 5:21 am
Location: NY

repost of above

Post by azariatech »

Sorry, posted as guest. should have logged in first.

Repost follows:
******************************
Not sure I'm going about this the right way and now I'm stuck. I've managed to creat two seperate search and replaces (easy pattern search, and I've tested each independently so I know each finds what i want) but I cant figure out how to get both of these pieces of data out and into the same tab delimited file.

What I have is basically the result of a formmail script submitting a weekly timesheet Near the top I need the employee's name and email address, then further down there are 7 repeating groups of data (7 records, with each field scattered onto it's own line).

I'd like to get this out into one pass to parse this for an excel spreadsheet.
Sample data is below. Names and email headers have been change to protect the innocent.

Any help much appreciated.
Thank you.




X-From_: *snipped* Sat Oct 1 13:44:46 2005
X-Envelope-From: *snipped*
Date: Sat, 1 Oct 2005 13:44:44 -0400
X-Authentication-Warning: web172.megawebservers.com: somedomain.com set sender to postmaster@someotherdomain.net using -f
X-Mailer: NMS FormMail 3.14c1
To: timesheets@somedomain.com
From: somemailer@somedomain.com (yourname here)
Subject: Time Sheet submission form
X-MOR: 0
X-MOP: 0
X-MMX: 0
X-MMC: 227
X-MMR: 0


Below is the result of your feedback form. It was submitted by
Mike Forrester (MikeAndIke@somewhereElse.com) on Saturday, October 01, 2005 at 13:44:44
---------------------------------------------------------------------------
SnailMailAddress: 321a somewhereoranother Street
City: New York
State: NY
zipcode: 10013
DataStartDelimeter: **--**--**
Date1: 01/01/05
TimeIN1: 9:00
TimeOUT1: 5:00 pm
Client Name1: jane
Work Location1: 321
Date2: 02/02/05
TimeIN2: 9:00am
TimeOUT2: 5:00pm
Client Name2: jack
Work Location2: 80cp
Date3: 03/03/05
TimeIN3: 11:00
TimeOUT3: 6:00 pm
Client Name3: jack
Work Location3: 80 cp
Date4: 04/04/05
TimeIN4: 9:00am
TimeOUT4: 5:00 pm
Client Name4: Jane
Work Location4: 321
Date5: 05/05/05
TimeIN5: 9:00 am
TimeOUT5: 5:00 pm
Client Name5: Jack and Jill
Work Location5: 1234 56th street apt. 78
Date6: 06/06/05
TimeIN6: 9:00 am
TimeOUT6: 12:30 pm
Client Name6: Mike and Ike
Work Location6: 2233 44th Street apt 55
Date7: 06/06/05
TimeIN7: 12:30 pm
TimeOUT7: 4:30 pm
Client Name7: Jack and Jill
Work Location7: 1234 56th street apt. 78
DataEndDelimeter: --**--**--
submit: Submit my hours
---------------------------------------------------------------------------
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Post by DataMystic Support »

See the report extraction white paper.

Essentially, place each piece of wanted data on a line by itself with a marker such as ###.

Then discard all non-matching lines and remove the marker.
Post Reply