|
Answer» First off let me thank all of the guys posting answers on this forum. I have found many answers to my never ending questions.
I have one that I can't track down.
I have a batch file that copies a file to a backup directory adding the date and time to the file then runs a macro from within Access to update a database file. Finally it ftp's the updated MDB file to a webserver. Once this is done I write a text string to a log file stating that on this date at this time the mdb file was updated and the backup file is now originalfileName_datetime.mdb. Currently the NEW log file entry is written to the end of the file thus putting it at the bottom of the list. The purpose of this log file is that if needed I want to open the file and see the latest backup file but I don't want to have to scroll all the way to the end. I know it's LAZY but hey - isn't that why they invented these silly things in the first PLACE? Thanks again guys.
BTW - I've INCLUDED the line that writes the log entry to my log file. I created the variable nDate and nTime as I wanted to use the same date and time used in the renaming of the database file in the log entry but I've already stripped out the "/" and ":".
>> dblog.txt echo -- %nDate% - %nTime% sellsheet table updated and posted to kcboxman.com. Current backup file is kcboxman_%fDate%%fTime%.mdb.Use a FOR loop.
Echo YOUR INFO HERE >logtemp.txt For /f "delims=" %%a in ('type logfile.log') do echo %%a >>logtemp.txt type logtemp.txt > logfile.log del logtemp.txt
Try that. Excellent! That worked perfectly and gave me just what I needed. Now I can preserve the update activity but if something happens I don't have to scroll to the bottom of a huge file to get the file name. I really appreciate it.
JimNo problem. You won't be able to use your current log file, as it will get messed up date-wise somewhere in the middle.
|