Archi Forum

Archi Plug-ins => jArchi => Topic started by: Alberto on August 02, 2022, 16:40:26 PM

Title: load CSV from URL
Post by: Alberto on August 02, 2022, 16:40:26 PM
I'm a JS idiot, so please bear with me. I'm trying to update the "Import from CSV" jArchi script from loading a local CSV file, to loading a CSV file from a URL, but can't quite find the JS command that will do so.  load() didn't work. Any other ideas?
Title: Re: load CSV from URL
Post by: Phil Beauvoir on August 03, 2022, 10:17:18 AM
I'm also not so brilliant with JS.  :D But is this more of a generalised JS task? I Googled it and found a few ways to connect to a URL and parse the data from the connection.
Title: Re: load CSV from URL
Post by: Jean-Baptiste Sarrodie on August 03, 2022, 16:18:28 PM
Hi,

you have to create the readFully() function that is able to get a local or remote file and return the content as a string on which you can work. You can find this function here: https://forum.archimatetool.com/index.php?topic=625.msg3499#msg3499

Regards,

JB