Re: Regex To get the Job Number and Corresponding state
Asad <[email protected]> Tue, 25 Feb 2025 22:44:53 +0530
| Newsgroups | gmane.comp.lang.perl.beginners |
|---|---|
| Message-ID | <CAG3LsKFsoc_DJBDdepVo2fF9s_dB4YhgfYx5Myanh=6GhzheDQ@mail.gmail.com> |
--00000000000019bdba062efa997f Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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=E2=80=AFPM Erick Paquin <[email protected]= > wrote: > 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 > > Client: zdmhost > > Job Type: "EVAL" > > ... > > Current status: SUCCEEDED > > Current Phase: "ZDM_SETUP_TGT" > > > > Thanks, > --=20 Asad Hasan +91 9582111698 --00000000000019bdba062efa997f Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr">The problem=C2=A0with grep is that line numbers may change= so even if i do grep -E=C2=A0=C2=A0 <span style=3D"color:rgb(0,0,0);font-family:Monaco,Consolas,"Bitstream= Vera Sans Mono","Courier New",Courier,monospace;font-size:1= 6px">SUCCEEDED|"\</span> <span style=3D"color:rgb(0,0,255);font-family:Monaco,Consolas,"Bitstre= am Vera Sans Mono","Courier New",Courier,monospace;font-size= :16px">"ZDM_SETUP_TGT\"" -B5 , it may not alway 5 line abov= e or is there a more better way in grep or regex</span><div><span style=3D"= color:rgb(0,0,255);font-family:Monaco,Consolas,"Bitstream Vera Sans Mo= no","Courier New",Courier,monospace;font-size:16px"><br></sp= an></div></div><br><div class=3D"gmail_quote gmail_quote_container"><div di= r=3D"ltr" class=3D"gmail_attr">On Tue, Feb 25, 2025 at 10:22=E2=80=AFPM Eri= ck Paquin <<a href=3D"mailto:[email protected]">[email protected]<= /a>> wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0= px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Y= ou can use grep for this..<br> <br> ---<br> Erick Paquin<br> <br> On 25/02/2025 11:49 am, Asad wrote:<br> > Hi All,<br> > <br> > I have a requirement to use regex=C2=A0 , find the Job ID for the Curr= ent<br> > status: SUCCEEDED and Current Phase: "ZDM_SETUP_TGT" from a = file<br> > which has data in the format gives below :<br> > <br> > Job ID: 52<br> > User: zdmuser<br> > Client: zdmhost<br> > Job Type: "EVAL"<br> > ...<br> > Current status: SUCCEEDED<br> > Current Phase: "ZDM_SETUP_TGT"<br> > <br> > Thanks,<br> </blockquote></div><div><br clear=3D"all"></div><div><br></div><span class= =3D"gmail_signature_prefix">-- </span><br><div dir=3D"ltr" class=3D"gmail_s= ignature"><div dir=3D"ltr">Asad Hasan<br>+91 9582111698</div></div> --00000000000019bdba062efa997f--