mIRC Home    About    Download    Register    News    Help

Print Thread
Help with clearing text file at month end #264381 25/11/18 07:59 AM
Joined: May 2013
Posts: 117
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 117
I don't no if this is possible. I keep monthly stats in my channel and need to clear the text file every month end. Any ideas?

Re: Help with clearing text file at month end [Re: raycomp] #264382 25/11/18 09:08 AM
Joined: Jan 2004
Posts: 1,234
maroon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 1,234
Not sure I understand. You have monthly stats you keep in a text file, and you want to know how to delete the file at month end?

Re: Help with clearing text file at month end [Re: raycomp] #264390 26/11/18 05:34 AM
Joined: Feb 2003
Posts: 2,669
Raccoon Offline
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,669
Rather than deleting the file, let's just keep it. Instead, write to a new and different file with the digits of the changing month and year.

Code:
ALIAS -l StatsFile return monthlystats- $+ $asctime(yyyy-mm) $+ .txt

On *:Event: {
  write $StatsFile some statistic
}

You will merely accumulate more and more files at a manageable rate.

monthlystats-2018-11.txt
monthlystats-2018-12.txt
monthlystats-2019-01.txt

etc.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Re: Help with clearing text file at month end [Re: Raccoon] #266370 24/11/19 09:44 AM
Joined: May 2013
Posts: 117
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 117
Maroon yes that is the idea

Re: Help with clearing text file at month end [Re: raycomp] #266372 24/11/19 10:57 AM
Joined: May 2013
Posts: 117
R
raycomp Offline OP
Vogon poet
OP Offline
Vogon poet
R
Joined: May 2013
Posts: 117
Racoon that wont help as users can check their own stats with a command that read from the chanstat.txt
Your idea will result in a new text file every month