#Auto-Rename a file
14 messages in this thread
I have a question. I am always capturing text from my online sessions so that
I can read and edit it later. My script in my term program opens up a capture
with the same name each time…..say CIS.TXT. Now, the only problem is, now
that I have a hard drive, sometimes I forget to rename the file, after it's
captured on the HD, and if I log on again and forget about the previous capture
file, it overwrites it!
Is there an easy script file that I could write, which would do something like
rename a file like that, by appending the current date/time on the end of the
filename? That would save my skin when I forget to do it myself.
Ideas?
+ Phil +
Phil, I've written a program a couple of months ago that does just that! It
will take a file and rename it to the same name with a date and time stamp.
E.G. CIS.TXT will be renamed into CIS.TXT_01.04.89_22:20
Interested?
Khalid.
YES! VERY interested! Sounds just like what I was looking for! Boy,
Khalid…..your always coming up with the most *useful* little software, eh?
+ Phil +
Phil, I just do programs that I feel I need. Anyway, I'll upload that program
to DL14. Should be up in a couple of days. Hmm.. dunno what I'll call it
yet.
Khalid.
Khalid,
That WordPerfect help program is very good. I'm using it regularly now – much
easier than searching the little keyboard strip. Thanks.
Betty
Betty, I use it a lot, too. I have uploaded a much better version to DL13
called HELP.ARC around 3 days ago. It's hasn't been merged yet. Maybe you'd
like to have a look at it.
Khalid.
Will look tonight, Khalid. Sorry it hasn't been merged yet.
BTW, Khalid, would you tell me more about your SX500? I have an SX64, too.
Betty
Thanks Khalid. Let me know when you have a name for it….I'll check it out.
+ Phil +
Phil, I polished up the program a bit and just uploaded it to DL14 as
STAMP.ARC. I guess it'll take a day or so before it gets merged. I also added
a 'copy' option to it which will copy the file and then stamp the copy.
Khalid.
Phil, I just checked. STAMP.ARC is already up on DL14. I hope it's what you
need.
Khalid.
Thanks again, Khalid! I'll check it out! Bye for now….
+ Phil +
Simple. Suppose your term prog is Access! and you keep CIS.TXT in the same
place all the time. Create a text file called,say, TERM:
FAILAT 30 ; IF CIS.TXT does not exist DO NOT abort the script
DELETE CISOLD.TXT
RENAME CIS.TXT CISOLD.TXT
access!
Type EXECUTE TERM from a CLI or, with Workbench, make XICON the default
tool of TERM. Note this will keep only your previous session and will
delete the one before last. — Art
Sounds interesting, but I wouldn't want to delete the old file….as a matter
of fact, that is one of the problems. I logon again, the term opens up the
SAME capture file again, and OVERWRITES the old one. I wanted to rename it to
a name with the current date/time attached, to keep track of it, and keep all
files intact.
I think Khalid may have come up with just what I was looking for….we'll see.
+ Phil +
I DO like the idea of making it work on workbench, though. Isn't that what
XICON does?
Yes, Khalid's utility is an ideal solution.
Yes XICON, IXECUTE, and a couple others all do the same thing. Just make
sure it is in your C; directory. Then create a batch file with your editor,
save it with an icon and use the INFO option from workbench to view the info
for that file. Make the default tool c:XICON (or whatever). Now you can
click on the file and it will run as a batch file using XICON.
There is one "gotcha." I find some/mV+_On?(Wm66 no@run through
XICON. The workaround is simple. Use the iconified batch file to open a
CLI, run another batch file and close again. Suppose the file that XICON
runs, say "StartTerm," contains the line:
NEWCLI FROM s:StartMyTermProg
If StartMyTermProg has the lines:
KhalidRename CISCAP.TXT
Access!
endcli
When you double click "StartTerm" a CLI will open up and run
"StartMyTermProg" in it. It will rename your file, start Access and the cli
will close when you quit Access. The CLI will hang around until Access is
done so you might want to make it smaller. Change StartTerm to
NEWCLI con:50\50\50\50\TermCLI FROM s:StartMyProg
— Art