SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
Rename all files
Goto page 1, 2  Next
 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
Rename all files
Author Message
rhubman16



Joined: 08 Mar 2016
Posts: 41

Post Rename all files Reply with quote
I need to get a list of all files in a directory and change the file extensions. What is the best way to do this in 24x7 script?

Thank you
Fri Apr 22, 2016 9:32 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Reply with quote
Do you need to apply any conditional IF...THEN logic or simply replace all files with a known extension to some other extension, for example *.txt to *.bak?
Fri Apr 22, 2016 9:43 am View user's profile Send private message
rhubman16



Joined: 08 Mar 2016
Posts: 41

Post Reply with quote
I need to change all of the .csv files to .old. for all of those file types in 1 directory, no subdirs.

Thanks
Fri Apr 22, 2016 9:52 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Reply with quote
The simplest method is to run a DOS command
cmd /C rename *.csv *.old
Fri Apr 22, 2016 10:11 am View user's profile Send private message
rhubman16



Joined: 08 Mar 2016
Posts: 41

Post Reply with quote
So I can just run a dos command somewhere in the JAL script? how would I do that?

I dont think I gave the full scope of what I am trying to do. during a script run, I need to rename the files.
Fri Apr 22, 2016 10:17 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Reply with quote
You can use RunAndWait JAL statement for that purpose
You can paste the syntax template using Paste JAL menu command in the editor.
Fri Apr 22, 2016 10:20 am View user's profile Send private message
rhubman16



Joined: 08 Mar 2016
Posts: 41

Post Reply with quote
The CMD line method worked when I tested it with a local drive but I need to use a UNC path. It always fails. Any other suggestions?
Tue Apr 26, 2016 9:02 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Reply with quote
Have you "escaped" backslashes correctly?
\\\\computer\\drive\\whatever\\file.txt
Tue Apr 26, 2016 10:21 am View user's profile Send private message
rhubman16



Joined: 08 Mar 2016
Posts: 41

Post Reply with quote
RunAndWait ( "cmd /C rename \\\\fileserver\\share\\f1\\f2\\f3\\*.csv \\\\fileserver\\share\\f1\\f2\\f3\\*.txt", "\\\\fileserver\\share\\f1\\f2\\f3" 60, renameid )

This is the command I am trying.
Tue Apr 26, 2016 10:30 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Reply with quote
What do you see in the job output files when you run that job. Are there any specific errors? Access denied?
Tue Apr 26, 2016 11:05 am View user's profile Send private message
rhubman16



Joined: 08 Mar 2016
Posts: 41

Post Reply with quote
No I am not getting any errors in the log.
Tue Apr 26, 2016 11:14 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Reply with quote
I meant job output capture files, not log

I'm sure cmd.exe can start fine. But you need to see what it prints to the output
Tue Apr 26, 2016 11:27 am View user's profile Send private message
rhubman16



Joined: 08 Mar 2016
Posts: 41

Post Reply with quote
Sorry, it the job output capture file, something I need to turn on? I have never used that before.

I really appreciate the help!!
Tue Apr 26, 2016 11:32 am View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Reply with quote
Hmm, your question makes me wonder if you are running 24x7 Multi-Platform edition or an old legacy version. In MP, that's a standard feature.
Tue Apr 26, 2016 11:37 am View user's profile Send private message
rhubman16



Joined: 08 Mar 2016
Posts: 41

Post Reply with quote
It is an older version 3.4.26.

I am not able to upgrade to any current versions at this time.
Tue Apr 26, 2016 11:39 am View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.