I have a log file that i need to be read and the information to be
placed in an access database, repeat the process every time new
information is added to the log.
Sample of the format of the log:
3/28/2005 11:51:15 AM - Order On -10- MS6/DEN G/ROD/
3/28/2005 11:51:51 AM - Order On -10- MS6/DEN G/ROD/
3/28/2005 12:02:12 PM Lights Off -26- cleared by Bro, Gay
3/28/2005 12:02:40 PM Lights Off -10- cleared by Bro, Gay
Thank you |
Request for Question Clarification by
hammer-ga
on
28 Mar 2005 09:30 PST
Which version of Access?
What is adding the information to the log?
How often should the program check for new information?
Should the log be cleared out after the information is read into the database?
What fields does the database have?
- Hammer
|
Clarification of Question by
amy123456-ga
on
28 Mar 2005 09:45 PST
1-Version 2000 0r 2003.
2- A c# program
3-every hour
4-The log could be cleared only if the information was being kept accurately.
5-date/time/pm or am/orders/state/room/floor/ptfirstname/ptlastname/
datecl/timecl/pmcl or amcl/orderscl/statecl/roomcl/floorcl/cleared
by/userlastname/userfirstname
Thank you
|
Request for Question Clarification by
hammer-ga
on
28 Mar 2005 11:16 PST
Is the data in the log file delimited by a character that does not
appear in the data itself? If not, can it be?
I'm asking because I'm looking for a way to reliably parse the line of
log data into the individual Access fields.
- Hammer
|
Clarification of Question by
amy123456-ga
on
28 Mar 2005 12:39 PST
The folowing is a copy of the log files as it exists.
3/28/2005 11:51:15 AM - Order On -10- MS6/DEN G/ROD/
3/28/2005 11:51:51 AM - Order On -10- MS6/DEN G/ROD/
3/28/2005 12:02:12 PM Lights Off -26- cleared by Bro, Gay
3/28/2005 12:02:40 PM Lights Off -10- cleared by Bro, Gay
I could add a delimeter. for example.
3/28/2005 11:51:51 AM / Order / On /10 MS6/DEN G/ROD/
3/28/2005 12:02:12 PM / Lights /Off /26/ cleared by /Bro/ Gay
Thank you
|
Request for Question Clarification by
hammer-ga
on
28 Mar 2005 13:42 PST
I can write you code that does this in Access.
Could you please detail for me which pieces of information in your
sample log file go into which fields in the Access database?
For this to work reliably, each line in the log file needs to have the
same number of values, separated by a delimeter, even if some of the
values are blank.
- Hammer
|
Clarification of Question by
amy123456-ga
on
28 Mar 2005 17:46 PST
date time / pm or am/ orders/state /room/
3/28/2005 11:51:51/ AM or PM/ Order / On / 1-28/
floor /ptfirstname/ptlastname/
MS6-8 /DEN G /ROD
datecl timecl /pmcl or amcl/orderscl/statecl /roomcl/floorcl/
3/28/2005 12:02:12/AM or PM / Lights / OFF / 1-28/ MS6-8 /
cleared by /userlastname/userfirstname
cleared by/Bro /Gay
|
Clarification of Question by
amy123456-ga
on
29 Mar 2005 03:42 PST
I known the fields look ackward- but that's so we can relate better
with the logfiles. The information that we capture from this log file
is - orders for a patient is enter into a hospital system. A log of
that transaction is logged. (The following is logged)
date_time / pm_am / orders/state /room/
3/28/2005 11:51:51/ AM or PM/ Order / On / 1-28/
floor /ptfirstname/ptlastname/
MS6-8 /DEN G /ROD
When a nurse verifies the order, it logs that info also. (The following is logged)
datecl_timecl /pmcl_amcl /orderscl/statecl /roomcl/floorcl/
3/28/2005 12:02:12/AM or PM / Lights / OFF / 1-28/ MS6-8 /
cleared_by /userlastname/userfirstname
cleared by/Bro /Gay
The data types are all text except date/time
Thank you
|
Request for Question Clarification by
hammer-ga
on
29 Mar 2005 05:06 PST
Amy123456,
It looks like your Access records have fields for an original log
transaction, then a second set of fields for a log line that appears
later when the transaction is "cleared". I don't see any way in your
data to reliably tell a "clear" from a regular other than the words
"cleared by" might appear somewhere in it. I also don't see a way to
locate the original transaction that is being cleared to complete it,
rather than creating a new record.
What if we do the following:
1. Add a TrxType field to your database which would have values of
either ORDER or CLEAR.
2. Remove the "cleared" fields from your database and have a single
set of fields - trxDateTime, trxAmPm, trxTag, trxState, trxRoom,
trxFloor, trxFirstName, trxLastName
Then, we can bring in your log file. It would be best if you could
include a tag in your log file that clearly idenitified the type of
trx, such as "OR" and "CL". Otherwise, I'll have to look for the
phrase "cleared by" in the line and assume that, if I find it, it's a
CLEAR.
It would also be good if you could assign a unique id to your order
that is also attached to the clear, so you can match them up, but I'm
not sure what you can control for whatever is writing out the log.
Does the above sound good to you? Let me know.
- Hammer
|
Clarification of Question by
amy123456-ga
on
29 Mar 2005 08:27 PST
That sounds good. But on the iniquick id (OR Cl. You can tell weather
it is an order or a clear. Orders will have a state of ON always.
Cleared will have a state of OFF always.
Example. When an order comes in, it logs that action. for me to know
when the CLEARED in initiated i will look for the first OFF state for
the same room number.
I could have several orders , but only one clear action for that room #.
|
Request for Question Clarification by
hammer-ga
on
29 Mar 2005 08:41 PST
Amy123456,
Good. That last clarifiaction gave me what I needed to know. I'll
write you up some code and a sample mdb to play with.
- Hammer
|
Clarification of Question by
amy123456-ga
on
29 Mar 2005 10:18 PST
Thank you
|