I have the output of a process which on status change of the object being processed appends status,timestamp to the record in the text file...
so i end up with output something like:
task123,TERMINAL,glob,5,INITIAL,2012-02-27 16:48:07,PREPARING,2012-02-27 16:49:06,SCHEDULED,2012-02-27 16:49:06,TRANSLATING,2012-02-27 16:49:07,TERMINAL,2012-02-27 16:50:52
task345,COMPLETE,glob2,6,INITIAL,2012-02-27 16:48:07,PREPARING,2012-02-27 16:49:06,SCHEDULED,2012-02-27 16:49:07,TRANSLATING,2012-02-27 16:49:22,LOADING,2012-02-27 16:50:53,COMPLETE,2012-02-27 16:50:53
what i'd like to do is parse this into a set of variables for a given job (i'll end up looping through the file record by record)...
what i'm not sure is how to get the value after a matched string and save it in a variable...
so for example i want to save the timestamp following "PREPARING" into a variable called v_PREPARING
and i want to iterate through the line to get all of these values... the good thing i guess (though not sure how its helpful) is that the value after glob/glob2 is a count of the number of status' on that line...
thoughts?