Re: Regex To get the Job Number and Corresponding state

2025-02-25 Thread Asad
Thanks a lot. On Wed, 26 Feb 2025 at 8:55 AM, Jim Gibson wrote: > If you are reading a file with normal line endings (e.g., “\n”), then you > want to parse each line as “key: value” using a regular expression, save > the job id, current status and current phase values. When you have all > three

Re: Regex To get the Job Number and Corresponding state

2025-02-25 Thread Jim Gibson
If you are reading a file with normal line endings (e.g., “\n”), then you want to parse each line as “key: value” using a regular expression, save the job id, current status and current phase values. When you have all three, you can check the status and phase values for the values you are lookin

Re: Regex To get the Job Number and Corresponding state

2025-02-25 Thread Dermot
What is the record separator? How can we tell `Job ID: 52` from `Job ID: 51`? The input record separator is newline by default. If you want the Job ID of the records where status=SUCCEEDED, you'll need to set the record separator to something other than "\n" and do a multi-line search.`/m`. I thin

Re: Regex To get the Job Number and Corresponding state

2025-02-25 Thread Asad
The problem with grep is that line numbers may change so even if i do grep -E SUCCEEDED|"\ "ZDM_SETUP_TGT\"" -B5 , it may not alway 5 line above or is there a more better way in grep or regex On Tue, Feb 25, 2025 at 10:22 PM Erick Paquin wrote: > You can use grep for this.. > > --- > Erick Pa

Re: Regex To get the Job Number and Corresponding state

2025-02-25 Thread Erick Paquin via beginners
You can use grep for this.. --- Erick Paquin On 25/02/2025 11:49 am, Asad wrote: Hi All, I have a requirement to use regex , find the Job ID for the Current status: SUCCEEDED and Current Phase: "ZDM_SETUP_TGT" from a file which has data in the format gives below : Job ID: 52 User: zdmuser Cl

Regex To get the Job Number and Corresponding state

2025-02-25 Thread Asad
Hi All, I have a requirement to use regex , find the Job ID for the Current status: SUCCEEDED and Current Phase: "ZDM_SETUP_TGT" from a file which has data in the format gives below : Job ID: 52 User: zdmuser Client: zdmhost Job Type: "EVAL" ... Current status: SUCCEEDED Current Phase: "ZDM_SETU