Hi everybody!
I'm currently developping a small database interface
using Perl. The whole thing deals with courses at a
school for fire fighters in Regensburg (Bavaria, Germany).
The goal is to delete entries automatically by comparing
the courses beginning date with the current date. The
deleted data should be written into a new CSV file to
have a complete overview at the end of the year.
An example: let's pretend the course "Bootsführer" starts
on 13-05-02 (European date format: the 13th of May, 2002).
It should be deleted and re-written in a new CSV file
(same format) some days ahead, let's say on 06-05-02.
The data file looks like this:
01-02-C21-001-02|W|Bootsführer|13-05-02|17-05-02|12
01-02-C28-001-02|W|Techn. Hilfeleistung RW|11-03-02|15-03-02|32
01-02-C04-001-02|G|Leiter einer Feuerwehr|07-01-02|10-01-02|24
(and so forth...)
Here is what I assume:
1. We have to accomplish some date comparison based on epoch time
(seconds since 01/01/1970)
2. We need to establish some temporary file during the processing
of the original file otherwise we cannot write the entries to be
deleted into a new file. (...Can we?)
3. May be a cron job is necessary to make sure that the required
processing is done without having to call the script manually (or,
whilst users log in), e.g. at 11:55 p.m. each and every day...
Perhaps somebody out there has already been confronted with similar tasks.
I'd appreciate your help very much! - Thank you in advance for any useful hint.
Greetings from Bavaria -
Andreas
andreasfeiner@firemail.de
If you can't read German:
Feuerwehr = fire department
Bootsführer = boat captain
Techn(ische) Hilfeleistung = technical support
Leiter = chief
Field 4 (Perl count: 3): beginning of the resp. course
Field 5 (Perl count: 4): ending of course
Date format: dd-mm-yy
I'm currently developping a small database interface
using Perl. The whole thing deals with courses at a
school for fire fighters in Regensburg (Bavaria, Germany).
The goal is to delete entries automatically by comparing
the courses beginning date with the current date. The
deleted data should be written into a new CSV file to
have a complete overview at the end of the year.
An example: let's pretend the course "Bootsführer" starts
on 13-05-02 (European date format: the 13th of May, 2002).
It should be deleted and re-written in a new CSV file
(same format) some days ahead, let's say on 06-05-02.
The data file looks like this:
01-02-C21-001-02|W|Bootsführer|13-05-02|17-05-02|12
01-02-C28-001-02|W|Techn. Hilfeleistung RW|11-03-02|15-03-02|32
01-02-C04-001-02|G|Leiter einer Feuerwehr|07-01-02|10-01-02|24
(and so forth...)
Here is what I assume:
1. We have to accomplish some date comparison based on epoch time
(seconds since 01/01/1970)
2. We need to establish some temporary file during the processing
of the original file otherwise we cannot write the entries to be
deleted into a new file. (...Can we?)
3. May be a cron job is necessary to make sure that the required
processing is done without having to call the script manually (or,
whilst users log in), e.g. at 11:55 p.m. each and every day...
Perhaps somebody out there has already been confronted with similar tasks.
I'd appreciate your help very much! - Thank you in advance for any useful hint.
Greetings from Bavaria -
Andreas
andreasfeiner@firemail.de
If you can't read German:
Feuerwehr = fire department
Bootsführer = boat captain
Techn(ische) Hilfeleistung = technical support
Leiter = chief
Field 4 (Perl count: 3): beginning of the resp. course
Field 5 (Perl count: 4): ending of course
Date format: dd-mm-yy