Topic
  • 1 reply
  • Latest Post - ‏2013-02-14T19:48:17Z by llandale
SystemAdmin
SystemAdmin
3180 Posts

Pinned topic parse file

‏2013-02-14T13:57:58Z |

Hello,

how would one parse the transition log the print a csv file in the following format? I am assuming reg expression would be the best solution just not sure of the correct syntax for my problem. Any help would be appreciated. Thank you.

record ID, entered, 2012/03/06 16:51:18, assigned, 2012/05/31 13:12:15, resolved, 2012/05/31 13:23:12, obsolete, 2013/02/13 10:56:52

-Jim
 

Submitted to entered by Ahmed Tawfik (ahmed.tawfik) on 2012/03/06 16:51:18
...
Text
...
Transitioned to assigned by Constance Walker (constance.walker) on 2012/05/31 13:12:15
<comments not supplied>
...
Text
...
Transitioned to resolved by Ricky Parks (ricky.parks) on 2012/05/31 13:23:12
<comments not supplied>
...
Text
...
Transitioned to obsolete by _change_admin on 2013/02/13 10:56:52
Updated on 2014-01-06T13:27:20Z at 2014-01-06T13:27:20Z by iron-man
  • llandale
    llandale
    2972 Posts

    Re: parse file

    ‏2013-02-14T19:48:17Z  

    Let me scribble to start things off

    Regexp re_Submitted = regexp2(    //
            "^Submitted to "
            "(entered)"           // match 1 status ignored -
            " by "
            "(.*\(.*\))"          // match 2 Name ignored looks like 'Ahmed Tawfik (ahmed.tawfik)' -
            " on "
            ".*"                  // match 3 Date, looks like '2012/03/06 16:51:18'       -
                            )
    Regexp re_Transmitted = regexp2(        
            "^Submitted to "
            "(.*)"                        // match 1 status -
            " by "
            "(.*\(.*\))"          // match 2 Name ignored looks like 'Ahmed Tawfik (ahmed.tawfik)' -
            " on "
            ".*"                  // match 3 Date, looks like '2012/03/06 16:51:18'       -
                            )
    


    -Louie

    Updated on 2014-01-06T13:27:34Z at 2014-01-06T13:27:34Z by iron-man