<?xml version="1.0" encoding="utf-8"?>
<feed xml:lang="en" xmlns="http://www.w3.org/2005/Atom"><title>Recent posts to read big csv file</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/75cd0cabb2/" rel="alternate"/><link href="https://forge.codesys.com/forge/talk/Runtime/thread/75cd0cabb2/feed.atom" rel="self"/><id>https://forge.codesys.com/forge/talk/Runtime/thread/75cd0cabb2/</id><updated>2020-02-27T15:23:02.834000Z</updated><subtitle>Recent posts to read big csv file</subtitle><entry><title>read big csv file</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/75cd0cabb2/?limit=25#9ff1" rel="alternate"/><published>2020-02-27T15:23:02.834000Z</published><updated>2020-02-27T15:23:02.834000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.com34f63825c9c95043448b214ec72397efd37d7b69</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;I made some mistakes on last code (in _new):&lt;/p&gt;
&lt;p&gt;That is a resume of my code. You have to manage errors on case of reading fail. And at the end parse code over strings is not filled.&lt;/p&gt;
&lt;p&gt;I have not test it, it could contain some mistakes,&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Captura de 2017" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=2771"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>read big csv file</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/75cd0cabb2/?limit=25#349c" rel="alternate"/><published>2020-02-27T15:23:00.901000Z</published><updated>2020-02-27T15:23:00.901000Z</updated><author><name>tonverra</name><uri>https://forge.codesys.com/u/tonverra/</uri></author><id>https://forge.codesys.comb13fea1ccd29ae463f9bbb4de411459eac85c363</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thank you so  much! &lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>read big csv file</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/75cd0cabb2/?limit=25#5e5b" rel="alternate"/><published>2020-02-27T15:23:00.256000Z</published><updated>2020-02-27T15:23:00.256000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.com3fc927bd0d53c30d9a4f3e0857c4ed78acfdd840</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;this is a simplified example:&lt;/p&gt;
&lt;p&gt;I recomend to you that a buffer be in a separate FB which manages the construction and destruction of it,&lt;/p&gt;
&lt;p&gt;The same for the double array, an FB with the double array and get and set methods to control array bounds.&lt;/p&gt;
&lt;p&gt;In array creation add 1 byte more to put the last string 0.&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: Captura de 2017" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=2770"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>read big csv file</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/75cd0cabb2/?limit=25#e26c" rel="alternate"/><published>2020-02-27T15:22:58.403000Z</published><updated>2020-02-27T15:22:58.403000Z</updated><author><name>tonverra</name><uri>https://forge.codesys.com/u/tonverra/</uri></author><id>https://forge.codesys.com5175701d10588253a385dc6a1f4b7e35c482007a</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Thanks for the explanation!&lt;/p&gt;
&lt;p&gt;Any chance you could post some example code/project?&lt;/p&gt;
&lt;p&gt;I got it to work, but am looking at individual bytes (ASCII) and combining/converting those to INTEGER values. I am sure there are more elegant ways of doing this..&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>read big csv file</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/75cd0cabb2/?limit=25#4cde" rel="alternate"/><published>2020-02-27T15:22:57.762000Z</published><updated>2020-02-27T15:22:57.762000Z</updated><author><name>josepmariarams</name><uri>https://forge.codesys.com/u/josepmariarams/</uri></author><id>https://forge.codesys.com25b200a1309c91a7ad5f94059620014f0c47ede7</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi.&lt;/p&gt;
&lt;p&gt;For reading csv, first i ask about csv size using sysfile.getsize, after that i make a __new(byte,size+1) over a byte pointer.&lt;/p&gt;
&lt;p&gt;To read values, you can create an array of arrays of pointer to string (first array are rows). You can go over the big array pointing the strings after field separators and subst the field separator by an 0. (End line changes first array).&lt;/p&gt;
&lt;p&gt;You can put all inside a fb and acces fields via get(x,y).&lt;/p&gt;
&lt;p&gt;Don't forget to destroy dynamic memory previous a new read and destroy it in fb_exit.&lt;/p&gt;
&lt;p&gt;To write csv, the dynamic array is a little bit mor complicated.&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>read big csv file</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/75cd0cabb2/?limit=25#0cdc" rel="alternate"/><published>2020-02-27T15:22:57.115000Z</published><updated>2020-02-27T15:22:57.115000Z</updated><author><name>tonverra</name><uri>https://forge.codesys.com/u/tonverra/</uri></author><id>https://forge.codesys.comb56da18fd58c26e295ba1e90bb469c456453b261</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;Hi!&lt;/p&gt;
&lt;p&gt;If I may hook into your thread.. &lt;/p&gt;
&lt;p&gt;Do you have any luck with this?&lt;br/&gt;
Are you able to do this with smaller csv files?&lt;br/&gt;
Where do you store your csv?&lt;/p&gt;&lt;/div&gt;</summary></entry><entry><title>read big csv file</title><link href="https://forge.codesys.com/forge/talk/Runtime/thread/75cd0cabb2/?limit=25#8262" rel="alternate"/><published>2020-02-27T15:22:55.197000Z</published><updated>2020-02-27T15:22:55.197000Z</updated><author><name>hki75</name><uri>https://forge.codesys.com/u/hki75/</uri></author><id>https://forge.codesys.comf48d78d171903e083b41ed5648c43f8ee5310674</id><summary type="html">&lt;div class="markdown_content"&gt;&lt;p&gt;in order to read a csv file, I usually use the FILE.Read FB from File from CAA_File.Library&lt;/p&gt;
&lt;p&gt;The read data is stored into the the ADR(buff) area: how get big amount of data? (buffer size &amp;gt;xxxxxxxxxxxxx): Get multiple file-read?how to split reading operations?&lt;/p&gt;
&lt;p&gt;&lt;img alt="IMG: 05" rel="nofollow" src="https://forum.codesys.com//download/file.php?id=2639"/&gt;&lt;/p&gt;&lt;/div&gt;</summary></entry></feed>