Using asLineChart plugin - Forum

Forum Navigation
You need to log in to create posts and topics.

Using asLineChart plugin

Hi,

I'm using asLineChart plugin to plot a figure in my software. I want to read the X and Y data from a .csv file. In order to use the asLineChart plugin, the data should be separated by the sign "|".

How can I store the data of a line of a .csv file in a variable and separate them by "|" character?

@saeid

How can I store the data of a line of a .csv file in a variable and separate them by  |  character?

I have not used asLineChart; so I am not familiar with the exact format of the expected data. Also, I am not sure how your csv data is formatted.

Perhaps you can post a few mockup lines of both, your csv data lines and the data expected by asLineChart.

luishp has reacted to this post.
luishp

@saeid

You can use the special character [#124] to write the vertical bar.

You can use the StrReplace command to replace the delimiter in the CSV file.

luishp and as3856 have reacted to this post.
luishpas3856

Hello,

Use "FileLen" to get the number of lines.

Use "Fileread" in a loop to read each line.

Use "StrReplace" to replace the csv delimiter with your wanted | char.

Save each line string in an array.

Regards

 

Vadim has reacted to this post.
Vadim

Hello,

By the way: When your csv fies has a header line with column names, your loop has to start with line 2 !

And looping filelen-1 !

Regards

Hans-Peter

 

@gaev

@vadim

@hpw

Thank you all for your help.