Hi Monks,

I have been working on home project to check the status of syncing my documents. The syncing process is called a job and and for each job I want to check for the status of three things for on the current day: 1.) Synchronizing started 2.) Synchronizing finished 3.) Summary with Files Processed, Files copied and Bytes processed. Eventually, I would like to take each part such as Files processed, Files copied and Bytes processed and put it in a MySQL database so that I can just run queries against it to check on past Successes and make some stats. That said, I am having problems with getting all three of the items together for each individual job. I appreciate any assistance, suggestions, ideas. Thanks again.

my $today = get_cur_time(); ### Defining Jobs @jobs = ("Allway Job"); ### Defining Print Header print "\n======================================\n"; print "\n Homebrew Reporting Program\n\n"; print " Today: $today\n"; print "\n======================================\n\n"; ### Opening Allway Sync Log File open(FH1,"C:\\Documents and Settings\\localadmin\\Application Data\\Sy +nc App Settings\\_SYNCAPP\\default.log") || die "Cannot open file:$!\n"; ### keep Log open while reading while((<FH1>)) { ### $date =~ s/\[//; foreach $job (@jobs) { if( $date eq $today && /Synchronizing started/ || /Synchronizing finis +hed/ || /Summary/ ) { #$syncStartD = substr($_,1,9); #$syncStartT = substr($_,11,7); #$syncStartjobName = substr($_,20,120); #$filesProcessed = substr($_,21,44); print $_; # "$syncStartD$syncStartT$syncStartjobName$filesProcessed\ +n"; }; }; }; ### Subroutines for current date sub get_cur_time { my ($Day, $Month, $Year) = (localtime(time))[3..6]; $Year += 1900; $Month = sprintf '%02d', $Month + 1; $Day = sprintf '%02d', $Day; return "$Month/$Day/$Year"; }; __DATA__ [3/21/2008 12:48 PM] Synchronizing started, job: "Allway Job" [3/21/2008 12:48 PM] Analyzing finished, job: "Allway Job" [3/21/2008 12:48 PM] Deleting: "C:\test\_SYNCAPP\temp" ... [3/21/2008 12:48 PM] Deleting: "c:\test\_SYNCAPP\temp" ... [3/21/2008 12:48 PM] Preparing metadata ... [3/21/2008 12:48 PM] Flushing drive "\\.\C:" buffers ... [3/21/2008 12:48 PM] Writing File: C:\test\_SYNCAPP\metadata.xml" ... [3/21/2008 12:48 PM] Writing File: "c:\test\_SYNCAPP\metadata.xml" ... [3/21/2008 12:48 PM] Flushing drive "\\.\C:" buffers ... [3/21/2008 12:48 PM] Flushing drive "\\.\c:" buffers ... [3/21/2008 12:48 PM] Synchronizing finished, job: "Allway Job" [3/21/2008 12:48 PM] Summary: Files processed: 18; Files copied: 0; By +tes processed: 180,372; Bytes copied: 0.


In reply to Parsing Unstructured Data by raj8

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.