Wolfram: Read File from Web

By Xah Lee. Date: .

read file from web

here's how to read a file from the web in Wolfram language. (similar to unix curl or wget) just use Import.

WolframLang read file from web 2024-12-03 090952
WolframLang read file from web 2024-12-03 090952
xx = Import["http://xahlee.info/emacs/emacs/doge.txt" ]

xx

Download a File from Web

URLDownload[URL]

Download a file.

returns a file object that contains the full path of the downloaded file, e.g.

File["C:\Users\xah\AppData\Local\Temp\doge-b3f932c7-c1d3-4289-b8a3-28a95e9c6ce2.txt"]

by default, file is downloaded to

$TemporaryDirectory

$TemporaryDirectory
(* C:\Users\xah\AppData\Local\Temp *)
xx = URLDownload["http://xahlee.info/emacs/emacs/doge.txt" ]

(* File[C:\Users\xah\AppData\Local\Temp\doge-b3f932c7-c1d3-4289-b8a3-28a95e9c6ce2.txt] *)

WolframLang, Shell Scripting Tasks