Regex the captured data

Above is the screen of PUTTY application.

We can capture the whole screen using get text activity ( Since we can’t capture only the required text in putty screen)

Our requirement is getting only the month & Date of secinfo, Reginfo & ACL file from captured text. ( Last modified date of file)

Once we captured the only the month & Date of secinfo, Reginfo & ACL, We need to validate if the file modified date of the files is Less than or equal to 90 days from today date.

If the last file modified is less or equal to 90 days then take screenshot else don’t.

Kindly help me to capture below:

• Only month & Date of secinfo, Reginfo & ACL files
• Validate if the file modified date of files is Less than or equal to 90 days from today date.

Hi @Sathish_Kumar_S

Can you share the text captured?

Meanwhile, you can try out this xaml

RegexTheCapturedData.xaml (10.3 KB)

The regex expression used is

([A-Z][a-z]{2} {1,2}\d{1,2}) \d{2}:\d{2} (secinfo|reginfo|ms_acl_info)\r?$
1 Like

Text from ACL File :grinning:

hik:dm 76> ls -ltr /usr/sap/HMS/SYS/global/ | grep -i info
-rw-r–r-- 1 hmsadm sapsys 314 Jun 20 12:49 ms_acl_info.old
-rw-r–r-- 1 hmsadm sapsys 314 Jun 20 12:50 ms_acl_info

Text from Reginfo & Secinfo file

hi:m 67> ls -ltr /usr/sap/HMS/DVEBMGS09/data | grep -i info
-rw-rw---- 1 hmsadm sapsys 429 May 11 2019 secinfo.old
-rw-rw---- 1 hmsadm sapsys 414 May 27 2020 reginfo.old
-rw-r----- 1 hmsadm sapsys 415 Jun 2 15:21 reginfo_bckup_02062022
-rw-r----- 1 hmsadm sapsys 447 Jun 30 09:11 secinfo
-rw-r----- 1 hmsadm sapsys 6220 Jun 30 09:12 reginfo

@Sathish_Kumar_S

Did you try the above approach

Thank you…i will try and let you know the result

Thank you. it worked

1 Like

@kumar.varun2

I have changed the last modified date from 90 days to 2 days and tested.

Last modified date of the file is : 06/20/2022 00:00:00

But still the code is giving result as the file was last updated in 2 days

What could be wrong?

@Sathish_Kumar_S

A slight modification

FileCheck=

If((Today.Date-FileModifyDate.Date).Days <= 2, "Yes", "No")

Thank you… Let me try

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.