read

<<

read file from given path


Parameters

read file :string

Attributes

lines read file lines into block
json read Json into value
csv read CSV file into a block of rows
withHeaders read CSV headers
html read HTML into node dictionary
xml read XML into node dictionary
markdown read Markdown and convert to HTML
toml read TOML into value
bytecode read file as Arturo bytecode
binary read as binary
file read as file (throws an error if not valid)

Returns

  • :string
  • :binary
  • :block

Examples

copy
; reading a simple local file str: read "somefile.txt"

copy
; also works with remote urls page: read "http://www.somewebsite.com/page.html"

copy
; we can also "read" JSON data as an object data: read.json "mydata.json"

copy
; or even convert Markdown to HTML on-the-fly html: read.markdown "## Hello" ; "

Hello

"

Related