FET Forum

FET Support (English) => Get Help => Topic started by: JOYAL ISAC S on February 11, 2025, 12:42:45 PM

Title: CSV Import
Post by: JOYAL ISAC S on February 11, 2025, 12:42:45 PM
Is it possible to import csv in time - teachers not available times. If so kindly share

Title: Re: CSV Import
Post by: Liviu Lalescu on February 11, 2025, 12:45:40 PM
Hello,

No, unfortunately not.

You might check the XML structure of the fet file, <Time_Constraints_List>, <ConstraintTeacherNotAvailableTimes>, and replicate that structure and copy/paste it in the fet XML file.
Title: Re: CSV Import
Post by: JOYAL ISAC S on February 11, 2025, 12:52:17 PM
Can you share any script to generate that replicated structure in fet XML file.
I have 400 teachers with varying Time Constraints.
Title: Re: CSV Import
Post by: Liviu Lalescu on February 11, 2025, 12:55:54 PM
No, I don't have such scripts. There is C++ code in the FET sources (in src/engine/timeconstraint.c, lines 7471-7492).
Title: Re: CSV Import
Post by: JOYAL ISAC S on February 11, 2025, 02:21:50 PM
Thank you. If possible, add an option to import csv in time - teachers not available times. Then this software will be the best one.
Title: Re: CSV Import
Post by: Liviu Lalescu on February 11, 2025, 02:25:27 PM
Oh, thank you for the kind words! It is on our TODO list, but it is complicated to think of a good way to implement it.
Title: Re: CSV Import
Post by: Volker Dirr on February 12, 2025, 02:47:12 PM
Yes, this will be a difficult one.

I fear for a clean csv it must be like:
"teachername,notAvailableDay,notAvailaleHour"
So you need to add a lot of lines for a single teacher.

Let us know if you have other/better ideas. I fear adding them in a single field seperated with other characters like "+" will be too difficult.

Maybe you have a better idea?!
Title: Re: CSV Import
Post by: gradgrind on February 13, 2025, 07:03:43 AM
I think it should not be too difficult to write a script to insert the data into the FET XML file, I have done quite a lot of that sort of thing. But what does the input data (the CSV) look like, what are the fields? That would determine how easy it is.
Title: Re: CSV Import
Post by: Volker Dirr on February 13, 2025, 08:56:48 PM
That is what a already wrote. I already described 2 variants.
a 3rd variant might be add more files for every new day and hour. But that is in fact not a valid csv format, since valid csv formats should have a fixed number of fields and always the same number of fields per line.

So I prefer one of the 2 variants that I wrote. But both variants also have other disadvantages (like long/complicated fields, if you separate hours and days with special characters. This also mean you can't sue that special characters anymore as names, except you also code escape sequences. So it is more difficult to code).
The variant with always new lines per hours and day is in fact very clean, valid and easy to code, but you always need to repeat the teacher name.

An other point is thinking about how to remove constraints. We should think about that also if we implement a new csv file format.

Which variant do you suggest? Maybe you have got an better idea?! Let us know.
Title: Re: CSV Import
Post by: gradgrind on February 14, 2025, 07:05:48 AM
Sorry Volker, my question wasn't clear enough. I meant the form/format of the data that JOYAL ISAC S actually has, not how it should be for a good CSV-import function (which of course you had already mentioned).
Title: Re: CSV Import
Post by: Volker Dirr on February 14, 2025, 10:55:56 PM
Sorry, I can't answer that. I don't know JOYAL ISAC S.