cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Did you know you can set a signature that will be added to all your posts? Set it here! X

Accessing a data file on the internet from mathcad worksheet

ebarsoukov
2-Explorer

Accessing a data file on the internet from mathcad worksheet

We have a problem with some of the mathcad tools that data-file they come with needs to be periodically

updated. The easiest way would be if we could like a file reading function to an internet location

of the latest file. But it does not appear to work. Is there any way to make it work and

to use addresses like ftp or html for example in READFILE?

Any vbscripts anybody developed to solve this problem?

Regards,
Yevgen

5 REPLIES 5
Werner_E
25-Diamond I
(To:ebarsoukov)

Have never used it but just gave it a try:

READPRN failed, but

Menu: Insert / Data / File_Input

worked with http:// target, too.

As you mentioned vbscripts I'm assuming we are talking about real Mathcad (V15-).

Thanks a lot. That works, and with data input wizard it works even with differnt data files like binary.

Now how about being able to un-compress a file inside mathcad? Some web-sites only allow

to put files on the web if they are compressed in *.zip format. Is there any way to load the zip file

as binary (that works, I tried) and than un-compress it inside mathcad itself?

I know that zip compression has been around for long time, so its algorithm is well known.

Did anybody implement the decompression in mathcad yet?

Regards,
Yevgen

Werner_E
25-Diamond I
(To:ebarsoukov)

I know that zip compression has been around for long time, so its algorithm is well known.

Did anybody implement the decompression in mathcad yet?

I've never seen an implementation and it wouldn't be that easy as there is not one but quite a lot of different compression algorithms possible in a zip-file. So you would be the first to implement a Mathcad zip decompression routine - if you finish, post it here please 😉

I can't provide the script but the best I could think of is fetch the zip-file in Mathcad and save it locally. Then, using a scripted component, decrompress is locally using one of the commandline decompression programs which sometimes accompany the zip-programs or maybe the GUI-version of your unzipper itself has a commandline mode.

Then you can load the unpacked file in MC the normal way.

Another way would be to try to fool the website in question by simply renaming the datafile to *.zip. Maybe even adding the magic two bytes "PK" in front of the file (in case the website looks for that signature of Phil Katz), which MC easily could discard.

Is there a way to load a binary file using similar method? I tried loading a binary file I get a string "d" as a result...

Announcements

Top Tags