Import/Export Comments with CSV

Started by Darren McDonald, July 01, 2021, 07:11:27 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Darren McDonald

Hi Liviu, as it's now possible to attach comments to a number of items in FET, would it be possible to include those comments (for subjects, teachers, rooms, etc.) in the exported CSV files, and similarly, to be able to import those comments from a CSV file as well?

I'm asking because this year my school will try to automatically import the FET timetable into our management system (SEQTA), and for this we will use the exported csv files. We use teacher names for teachers within FET (so that our HTML timetables are easily readable, and it's easy to work with), but we need to use their staff ID code for the synchronization. It would be great if all of that data could be stored within FET, and I was thinking of adding the staff ID code as a comment for each teacher, which, if they were exported with the teachers CSV file, would allow us to easily replace the teacher name in the timetable CSV file prior to importing that data into SEQTA.

Liviu Lalescu

Hello, Darren,

Yes, surely it is possible. Unfortunately, the import/export CSV was done by Volker and: 1) I don't know if he can do it soon, or 2) I am not sure I can understand his code and modify it, because he wrote it a bit in a cryptic way.

a) I will write him to see this topic, maybe he can help,

b) If he cannot help, I am willing to give it a try. If it is urgent, I could try to design a custom version just for you, to see how it's working, and after that maybe incorporate it into the official FET. If it is not urgent, I could go slower and make sure the code it good according to what Volker did until now.

Darren McDonald

Hi Liviu, it's definitely not urgent!  :)

It's easy to accomplish what I need at the moment by keeping a separate CSV file that matches FET Teacher names with Teacher ID numbers, so I can use a lookup to quickly replace names with ID codes whenever necessary.

However, since comments are used throughout FET, I think that other users might find it helpful to be able to import/export those comments, as I suspect there are a number of ways this feature could be used.

Liviu Lalescu

Hi, Darren,

Let's wait for Volker's answer.

There are some difficulties: what if the comments contain the field separator or quote, and we should also think of import/export of virtual rooms (which is not done properly until now).

Liviu Lalescu

Also, the comments may spread on multiple lines.

But all these problems should be manageable. I'll try this, if Volker can't.

Liviu Lalescu

Hello again, Darren,

Volker cannot do it now.

I am afraid of two things:

1) Messing up the entire import/export, because it is not my code and Volker wrote it in a way which seems cryptic to me.

2) The comments should be converted to a single line when exporting. Then, when importing, again we cannot import multi-line comments.

I will think of this.

Liviu Lalescu

Hello, Darren,

I did it, there is a snapshot to test, please see the snapshots section (

Thank you for suggesting this!