Anonymous_User Absent Member.
Absent Member.
2604 views

Renaming file in Aegis


I have a process that I need to make rename a file with the yyyymmdd
(the current year-month day)in the name of the file. Example
*testfile.txt *needs to be renamed to *testfileyyyymmdd.txt*.
Not sure on how to accomplish this.
Can some one assist me?
Thanks
Ed


--
ed_knight
------------------------------------------------------------------------
ed_knight's Profile: https://forums.netiq.com/member.php?userid=4448
View this thread: https://forums.netiq.com/showthread.php?t=49374

0 Likes
1 Reply
Anonymous_User Absent Member.
Absent Member.

Re: Renaming file in Aegis


Hi Ed - Sorry I don't get notifications anymore for posts so sorry for
the delay.

One way of doing this is first to split the filename into the name and
extension using the 'Extract Nth Match of Regular Expression' activity.
Use the filename as input string.
Use (.+)\.(.+) as the regular expression
Use 1(1,2) as the Segments
Leave everything else as default.
The output array of the activity will have the name in the first element
of array and file extension is second part of array.

Next use the 'convert UNIX timestamp to Text' to get the yyyymmdd part.
Use yyyyMMdd as the Output Format. Be sure to use a capital MM as mm
will output the minutes part of time.
You can use the workitem start time or other time source as the time
input.

Now you can combine the outputs of the regular expression activity and
the convert time activity using input builder to give the required
format.


--
martincotter
------------------------------------------------------------------------
martincotter's Profile: https://forums.netiq.com/member.php?userid=3942
View this thread: https://forums.netiq.com/showthread.php?t=49374

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.