Network Automation Software We are currently migrating this forum
over to our HelpSystems domain. Please
post all new threads in our new
HelpSystems Community Portal.
Post to the HelpSystems Forum
You are not currently logged on. You must be logged on in order to post. Log on
Or Create a new account
AutoMate Discussion
Decrease font size
Increase font size
Topic Title: Rename file to include date
Topic Summary: Rename file to include date
Created On: 08/13/2013 01:01 PM
Status: Read Only
Linear : Threading : Single : Branch
Search Topic Search Topic
Topic Tools Topic Tools
View similar topics View similar topics
View topic in raw text format. Print this topic.
 08/13/2013 01:01 PM
User is offline View Users Profile Print this message

Author Icon
RyanAkana
Journeyman (50-99)

Posts: 53
Joined: 04/23/2013

For those who are interested in a task that will rename files to include a date regardless of file extension null or length varies.

Original Value,New Value

Test.txt,Test_20130813.txt

Test,Test_20130813

Test.txts,Test_20130813.txts

Test1.Test.2000.txt,Test1.Test.2000_20130813.txt




Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)
 08/14/2013 02:49 AM
User is offline View Users Profile Print this message

Author Icon
SarathiKamaraj
Artisan (200-499)

Posts: 244
Joined: 07/30/2012

A similar task for renaming but doesn't work for files without extension




Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
Thanks,
Sara
 04/28/2014 07:51 AM
User is offline View Users Profile Print this message

Author Icon
DanielHuff
Apprentice (20-49)

Posts: 43
Joined: 04/25/2014

I am trying to do something simular, but I need to remove the date instead of adding it.

file name: 28testfile
Rename to: file.txt

The 28 in the file name is the day of the month, which changes each day.  What kind of expression would I need to read the file and rename it correctly?

I was looking at some of the "Basic Functions" but I haven't found anything yet that works.

 



-------------------------
Daniel Huff - Automate System Administrator
 04/28/2014 01:34 PM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

Daniel, like this ?


Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------
Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4
 04/29/2014 07:17 AM
User is offline View Users Profile Print this message

Author Icon
DanielHuff
Apprentice (20-49)

Posts: 43
Joined: 04/25/2014

Well, the file I have is named 28testfile

I want to read it in and rename it to test.txt

The problem is that every day the file name will be different because the name is dependent on the day of the month.  So for today it will be named 29testfile, 30testfile, etc

So no matter what day I want to be able to rename it to test.txt



-------------------------
Daniel Huff - Automate System Administrator
 04/29/2014 02:40 PM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Daniel,

Is the file named 28testfile and you are changing it to test.txt or was that a typo?

If the date is always two digits the following expression will work for you.

%Mid(VarName, 3)%

If is not two digits please let us know so that we can adjust it for you.




Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 04/29/2014 09:08 PM
User is offline View Users Profile Print this message

Author Icon
JeanDelfosse
Supreme Guru (1000+)

Posts: 8883
Joined: 03/30/2005

Daniel,
in the steps I attached earlier, it took care of that, and it will always remove the day number of "today", whichever the day it runs on.

-------------------------
Jean Delfosse - Automate Beta Tester
Win7 Pro 64 bits -Win XP Pro SP3 32 bits - AM8, AM7, BPA10, BPA9, BPA8, BPA7, AM6 Enterprise, AM4
 12/02/2014 11:24 PM
User is offline View Users Profile Print this message

Author Icon
HansDe Jongh
n00b (>6 posts)

Posts: 2
Joined: 09/21/2006

hello,

I need a similar thing, but I already know the file name.
and I need a date+time in the filename.
The filename is order.csv and should be come orders_3-12-2014_823.csv

I tried it with the rename action but I don't know how to put a variable in the new name field.

thanks
 12/03/2014 03:46 PM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Hansde,

Can you please post your steps?

-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
 12/03/2014 04:09 PM
User is offline View Users Profile Print this message

Author Icon
Ricardo Castaneda
HelpSystems

Posts: 3424
Joined: 01/11/2008

Hi Hansde,

Please try the sample steps below with the rename action.

Let us know if that works for you.




Task Steps: (Right click, Select All, Copy to copy to the clipboard. Steps can then be pasted into the AutoMate Task Builder)


-------------------------

Ricardo Castaneda | Principal Support Analyst
AutoMate | Division of HelpSystems
HelpSystems, LLC | T: +1.213.738.1700
Statistics
18258 users are registered to the AutoMate Discussion forum.
There are currently 0 users logged in.
The most users ever online was 5551 on 01/08/2018 at 11:11 AM.
There are currently 1288 guests browsing this forum, which makes a total of 1288 users using this forum.

FuseTalk Enterprise Edition v4.0 - © 1999-2020 FuseTalk Inc. All rights reserved.

Sitemap Network Automation Software Blog