I need some advice on how to implement a header in a .csv. I created a dataloger with the libary SysFile. Currently I am checking if my .csv file exist and if not its created. After this iteration new values are written to it with SysFile.AM_APPEND_PLUS. Now I dont now to check if the File is already written or not, to decide if a header should be createt.
Thanks a lot for every tip or advise.
Best Regards
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi, I have ein paar suggestions, maybe it would helpful.
By header you mean some first string on the CSV file.
As I see, you have already checking for "created / not created".
So I guess you already splitted your code to 'Create File' and 'Append to old'.
So I suggest just to extend the first part with 'Create File and Write header to it'.
Maybe you have to arrange it with some CASE construction like:
OR you can even add some case for writing (because you are always writing) and combine different stringToWrite and fill it with header or process data string
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi everyone,
I need some advice on how to implement a header in a .csv. I created a dataloger with the libary SysFile. Currently I am checking if my .csv file exist and if not its created. After this iteration new values are written to it with SysFile.AM_APPEND_PLUS. Now I dont now to check if the File is already written or not, to decide if a header should be createt.
Thanks a lot for every tip or advise.
Best Regards
Hi, I have ein paar suggestions, maybe it would helpful.
By header you mean some first string on the CSV file.
As I see, you have already checking for "created / not created".
So I guess you already splitted your code to 'Create File' and 'Append to old'.
So I suggest just to extend the first part with 'Create File and Write header to it'.
Maybe you have to arrange it with some CASE construction like:
OR you can even add some case for writing (because you are always writing) and combine different stringToWrite and fill it with header or process data string