in reply to Re: Unique Data Formatting
in thread Unique Data Formatting

Thanks for your help, but just an update. It must have been a bad log file that I might have cut data out of it causing the response. However, the code section below doesn't account for any Job Name such as a Job Named 'My files' or 'My files 001'. I would want to capture the job name that is after the colon that could be any character, sets of characters or numbers such as:

[4/14/2008 4:45 PM] Synchronizing started, job: "My Files 01" [4/14/2008 4:45 PM] Synchronizing finished, job: "My Files 01" job: My Files 01 [4/14/2008 4:45 PM] Summary: Files processed: 6,554; +Files copied [4/14/2008 4:45 PM] Synchronizing started, job: "New Job 1" [4/14/2008 4:45 PM] Synchronizing finished, job: "New Job 1"

Replies are listed 'Best First'.
Re^3: Unique Data Formatting
by wfsp (Abbot) on Apr 19, 2008 at 06:08 UTC
    ...capture the job name that is after the colon that could be any character, sets of characters or numbers...
    But is the job name between the quotes? Include the quotes? Always at the end of the string? Is there a space after the colon, is that part of the name?

    Have a gander at the tutorials: perlrequick and perlretut. The perlre doc has the full low down.

    Adjust the following to suite.

    my ($job) = $str =~ / job : # "...the colon..." \s " # opening quote ( # start capture [^"]+ # one or more of anything that isn't a quote ) # end of capture " # closing quote $ # at the end of the string /x;