Append File
#1
Posted 12 September 2011 - 05:03 PM
I'd like to also see an option on the save file dialog that you can check to specify if you are updating or overwriting a file, this way when you are updating a file it doesn't prompt the user "You will overwrite this file, is this ok?".
#2
Posted 17 September 2011 - 09:04 AM
#3
Posted 24 October 2011 - 03:09 PM
I found a work around using shell command, which is really nice since it doesn't open a cmd window, but it causes the screen to flash repeatedly when run in loops.
An 'append' file similar to save to file would be extremely helpful. I'd love to see a "log()" function as well, but I can make my own if I had an append file. Loading an old file up and then saving it again works, but it isn't very efficient as a log file grows plus append file it extremely quick and light weight to just add line(s) to the end of a file or create it if it doesn't already exist.
#4
Posted 24 October 2011 - 05:03 PM
John
#5
Posted 24 October 2011 - 05:06 PM
Bob, if you're using .bat files to accomplish tasks, keep in mind you can create them on the fly (inserting variables, etc) before saving and running them. Just a thought if you're using shell a lot.
John
No, i'm using native cmd commands. All I am trying to do is append a file, so I am using shell echo.
#6
Posted 24 October 2011 - 07:12 PM
All Are Welcome To Join Us At The NEW "Uncensored" UBot Forum
__________________________________________
... this message has been approved by me...
#7
Posted 21 December 2011 - 11:51 AM
I wrote a batch file to take a parameter and append the new information to the old info. Then I use the shell command to execute the batch. (IE 'filename.bat variable') It works great. Using the variable makes sure that I don't overwrite the old data. HTH
Here is the exact code...
copy /a /y results%1.csv+temp_results%1.csv results1%1.csv
del results%1.csv
rename results1%1.csv results%1.csv
del temp_results%1.csv
#8
Posted 15 January 2012 - 11:36 AM
#9
Posted 19 February 2012 - 10:25 AM
This is something fundamental that needs to be there.
#10
Posted 19 February 2012 - 10:26 AM
I'm been looking around for the append command. And there isn't one?
![]()
This is something fundamental that needs to be there.
No, you have to load the old file, append it in memory, and save it out.
Which is fine for small files, but when using it to log stuff it adds unnecessary complexity and overhead. Large files it just slows it down too much.
Been asking for this for a while myself as well. Really would love to see it and it isn't complex.
#11
Posted 23 February 2012 - 06:51 AM
Instead of writing to one big file from an ever growing list.
You can create a folder structure that your bot uses to dump single status files.
For example one folder named failed and another folder named success.
As you process your list or do anything else you want to log, you can then save the results into the success or failed folders. But instead of writing anything into the file, you can just name the file the data or status you want to log or if the result does not lend itself to this, write the line into the file. You can use underscores for spaces in long results then strip them later.
This will require a bit more processing at the end but wont slow the bot down during the main process.
You can insert the underscores and the save to file command inside a thread. You can use the ext as a incremental number in case of duplicates. Once your done just read in the contents of the folders back into lists and save and do to them as you wish.
Edited by Abs1, 23 February 2012 - 06:56 AM.
#12
Posted 23 February 2012 - 04:25 PM
This isn't the most practical. But here is an idea for logging.
Instead of writing to one big file from an ever growing list.
You can create a folder structure that your bot uses to dump single status files.
For example one folder named failed and another folder named success.
As you process your list or do anything else you want to log, you can then save the results into the success or failed folders. But instead of writing anything into the file, you can just name the file the data or status you want to log or if the result does not lend itself to this, write the line into the file. You can use underscores for spaces in long results then strip them later.
This will require a bit more processing at the end but wont slow the bot down during the main process.
You can insert the underscores and the save to file command inside a thread. You can use the ext as a incremental number in case of duplicates. Once your done just read in the contents of the folders back into lists and save and do to them as you wish.
Yeah that is much to much. I have a few ways around it but I really just want a direct low impact way.
#13
Posted 28 May 2012 - 11:17 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











