CompuServe Thread

#Auto-Rename a file

14 messages in this thread
#28765From: Phil KoenigJan 4, 1989 5:31 AM
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 +
#28779From: Khalid AldoseriJan 4, 1989 12:05 PM
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.
#29105From: Phil KoenigJan 6, 1989 1:31 AM
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 +
#29118From: Khalid AldoseriJan 6, 1989 3:04 AM
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.
#29234From: Betty Clay/SYSOPJan 6, 1989 10:53 PM
Khalid, That WordPerfect help program is very good. I'm using it regularly now – much easier than searching the little keyboard strip. Thanks. Betty
#29285From: Khalid AldoseriJan 7, 1989 3:24 AM
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.
#29380From: Betty Clay/SYSOPJan 7, 1989 11:46 PM
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
#29470From: Phil KoenigJan 8, 1989 4:02 PM
Thanks Khalid. Let me know when you have a name for it….I'll check it out. + Phil +
#29121From: Khalid AldoseriJan 6, 1989 7:27 AM
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.
#29471From: Phil KoenigJan 8, 1989 4:03 PM
Thanks again, Khalid! I'll check it out! Bye for now…. + Phil +
#28793From: Art SteinmetzJan 4, 1989 1:19 PM
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
#29107From: Phil KoenigJan 6, 1989 1:35 AM
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?
#29127From: Art SteinmetzJan 6, 1989 9:05 AM
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