Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Free way to read and write CSV

galexis
2021-05-31
2021-06-10
  • galexis

    galexis - 2021-05-31

    Hi,
    I want to read and write CSV. What is the best way to do it for free ? And have you example ?
    Thank for your help.

     
  • galexis

    galexis - 2021-06-01

    Thank you, but I ask question because I didn't find recent solution with example.

     

    Last edit: galexis 2021-06-01
  • fleaplc

    fleaplc - 2021-06-10

    an example is pretty huge...and it'll referred to a specific file. In terms of concept you had to:
    1-open the csv file (FILE.Open FB) --> get header of file (file.CAA.HANDLE)
    2-using the header you read the 1st row (FILE.Read FB)
    https://help.codesys.com/webapp/VIPLMVOpanJfjqQXFKWGQlzGjxw%2FOpen;product=CAA%20File;version=3.5.17.0
    3-you have to update the header to the last character read (File.GetPos --> File.SetPos)
    4-read the 2nd row (FILE.Read FB)
    ......
    x - close the file (FILE.Close)

    I suggest to read Codesys help and try to read a small piece of a csv, then you'll can proceed to write something into csv

     

Log in to post a comment.