Citect, Delete Files Older then X.

kire

Member
Join Date
Apr 2014
Location
UK
Posts
55
Hi

I try to write a cicode function who shall delete all files files in a foler who is older then example 4 days.

Filenames format is like these:
10102015.701.csv
11102015.702.csv
12102015.701.csv
13102015.701.csv

I have found function Filedelete(),
but have not figure out how to use it in these matter...

Anyone give me a example?

Your feedback / input is feedback much appreciated.
[FONT=&quot][/FONT]
 
Hi

I try to write a cicode function who shall delete all files files in a foler who is older then example 4 days.

Filenames format is like these:
10102015.701.csv
11102015.702.csv
12102015.701.csv
13102015.701.csv

I have found function Filedelete(),
but have not figure out how to use it in these matter...

Anyone give me a example?

Your feedback / input is feedback much appreciated.
[FONT=&quot][/FONT]

Well the filedelete function is pretty straight forward and is all detailed in the help file, FileDelete("C:\Data\Report.Txt");

The trickier bit is deciding what's older than 4 days but if the filename contains the date it should be simple enough, you just need to read the filename, decide what's older than 4 days and call the filedelete function.
 
Well the filedelete function is pretty straight forward and is all detailed in the help file, FileDelete("C:\Data\Report.Txt");

The trickier bit is deciding what's older than 4 days but if the filename contains the date it should be simple enough, you just need to read the filename, decide what's older than 4 days and call the filedelete function.

Agree with you, but its is the tricki part, I need help for :)
Can I load current date and then take subtract 3 and delete rest?
Can you give me a example how can do something like that?
And what about a month have different numbers of days?
 
Agree with you, but its is the tricki part, I need help for :)
Can I load current date and then take subtract 3 and delete rest?
Can you give me a example how can do something like that?
And what about a month have different numbers of days?

Never done it myself but I would use FileSplitPath to give the the filename, then extract the date part, use Date function to get the current date then go from there.
 
I solve it my looking at age on the file itself and not the file name.

Thank you for respons.
 

Similar Topics

Hello, the system we use is Scada 7.5 series. We have usb key activ now we need additional key to make the system work, how do we solve this...
Replies
0
Views
46
So i've been at this for a long while, i have Citect Scada 2018, i have full access to everything but i can't seem to find any option or...
Replies
0
Views
68
Hello, i've been at this for months now, i tried creating accounts on the aveva website but it seems to never approve my accounts or at least when...
Replies
3
Views
100
Hello, I have a running project on Citect v5.42 and simatic net v6.4 I have created a new spare PC and loaded all software like Citect, station...
Replies
0
Views
78
Hello everyone, In a factory where we installed Citect 7.20 the computer began to show the first signs of end of life. They never considered...
Replies
0
Views
84
Back
Top Bottom