weglik
Visitor.
358 views

Read a date, read from file, compare

Hi,

I have a csv file with a date and username in each row.

My goal is to create a flow which will read the file, compare the date, and only process rows with the current date (today).

Basically, I have a tool which writes to the file user's last day in the office. I have an OO flow to disable user's AD account which runs on a schedule every night but processes all users from the file. 

If the flow can read only today's file, it would allow us to add accounts in advance.

Thanks

0 Likes
1 Reply
AndreiTruta Outstanding Contributor.
Outstanding Contributor.

Re: Read a date, read from file, compare

It can be achieved

You can read a file line by line

Split the username and date based on the "," delimiter and have two results on the read file step (username) and (date)

Grab the date and compare it with today's date

If it matches today you add a list appender thus create a list with those users that match today.

If it does not match today, do not go to the list appender but return to the line read.

 

PS: If you do not read line by line, you can add an extra list iterator with a delimiter on \n\r.

If you are doing this in cloudslang you could use some really cool python expressions that should give the end result. in cloudslang the read from file reads the entire file thus you'll end up addin a string comparator in a loop.

Andrei Vasile Truta
0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.