If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

A script that will download csv file and show it on a web page

Hello everyone.

I am new here. Just curious if you can help me with this....

Currently I am working on a automation project and one of the tasks I need to do is to show a data log on a web page.
Basically, a PLC (device that is used in industry automation) will save a data log .csv file on a web server. I need to
access that file and show it on a web page in a table. So far I have searched across the web for solution but a lot of
those solutions use jquery or PHP which I can't use (PHP because server can't use it, and jquery because it's too large, PLC has a limited memory space). Can you help me?

Know why is it necessary? Also, is there a way to display diffrent formatted csv files (with tab or space delimiter... or different delimiters in header and body)?

i'm not sure exactly what your first question is. datatables like to have the tables filled-in before it runs.

you could use the events of the TDC to reneder the datatables, but i don't see the exect event you need (on that fires when the table is drawn by TDC).
the closet one i can see is "datasetcomplete", but that's after the data is fetched and before the table is drawn.
this is exactly why i like people trying it out and reporting back. I'll add a new ondraw() event tonight, and let you know.
if you have it working meanwhile, awesome.

your 2nd question is easier to answer.

you can use many formats, you just need to define, at most, three things about the data source:

Code:

FieldDelim <param name="FieldDelim" value="," />Specifies the character used to mark the end of data fields.
RowDelim <param name="RowDelim" value="\n" />Specifies the character used to mark the end of each row.
TextQualifier <param name="TextQualifier" value="'" />Specifies the optional character that surrounds a field.

for a TDF as opposed to CSV, FieldDelim would be "\t", and the others can stay as defaults, not even needing to be included in the <object>.

thanks for trying it out, i really appreiciete you bearing with me and kicking the tires as i make it better

Create, Share, and Debug HTML pages and snippets with a cool new web app I helped create: pagedemos.com