How do I WriteLn> to beginning of file, Not the end
Thanks
WriteLn> to beginning of file
Moderators: JRL, Dorian (MJT support)
- Marcus Tettmar
- Site Admin
- Posts: 7395
- Joined: Thu Sep 19, 2002 3:00 pm
- Location: Dorset, UK
- Contact:
Write the string to a new file, then append the existing file to it, overwriting the existing file in the process. Delete the temporary file. So:
WriteLn>temp_new_file,r,This is a new line
AppendFile>temp_new_file,ActualFile,ActualFile,r
DeleteFile>temp_new_file
WriteLn>temp_new_file,r,This is a new line
AppendFile>temp_new_file,ActualFile,ActualFile,r
DeleteFile>temp_new_file
Marcus Tettmar
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
http://mjtnet.com/blog/ | http://twitter.com/marcustettmar
Did you know we are now offering affordable monthly subscriptions for Macro Scheduler Standard?
Here is another way to accomplish what you asking for.
I use the time to demonstrate that the script will write the new entry to line 1.
I use the time to demonstrate that the script will write the new entry to line 1.
Code: Select all
GetTime>TIME
ReadFile>%TEMP_DIR%\~TempMSFile.txt,result
let>K=%TIME%%CRLF%%result%
DeleteFile>%TEMP_DIR%\~TempMSFile.txt
WriteLn>%TEMP_DIR%\~TempMSFile.txt,r,%K%
exe>%TEMP_DIR%\~TempMSFile.txt