mIRC Home    About    Download    Register    News    Help

Topic Options
#264381 - 25/11/18 07:59 AM Help with clearing text file at month end
raycomp Offline
Vogon poet

Registered: 04/05/13
Posts: 103
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?

Top
#264382 - 25/11/18 09:08 AM Re: Help with clearing text file at month end [Re: raycomp]
maroon Offline
Hoopy frood

Registered: 12/01/04
Posts: 969
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?

Top
#264390 - 26/11/18 05:34 AM Re: Help with clearing text file at month end [Re: raycomp]
Raccoon Online
Hoopy frood

Registered: 18/02/03
Posts: 2501
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.
_________________________
doin´┐Ż things a particle can

Top