Engee documentation

Retrieving data from imported files

Before using Engee I/O functions, it is recommended to study the article Data import.

I/O functions are used to retrieve data from imported files:

Table of I/O functions
Purpose Function Description

Open

open

opens a file or data stream

isopen

determines whether the object (stream or timer) is already closed or not.

Close

close

closes an I/O stream

closeall

closes all open GUI windows

closeeread

closes only the read-from-file thread associated with the I/O object

closewrite

stops writing half of a full-duplex stream

Write

write

writes a canonical binary file representation of a value to the specified I/O stream or file

iswritable

checks if writing to the specified object is supported

Read

read

reads the contents of a file

read!

reads binary data from an I/O stream or file, filling the data matrix.

readavailable

reads available buffered data from a stream

readbytes!

performs a read of at most nb bytes from stream to b, returning the number of bytes to be read

readchomp

reads the entire file as a string and removes one line break character at the end (if any).

readdir

returns names in the directory (dir) or the current working directory if not specified.

readeach

returns an iterated object resulting in read(io, T)

readline

reads a single line of text from a given I/O stream or file.

readlines

reads all lines in an IO stream or file as vector or string values

readlink

returns the target location pointed to by a path symbolic link

readuntil

reads a line from an I/O stream or file (up to the specified delimiter character).

To extend the I/O capabilities of specific formats, use the appropriate Julia packages (for more information on installing them, see here). For example, the difference in working with a CSV file with CSV.jl package and without the package is shown in the table below:

User action

C CSV.jl

Without CSV.jl

Installing

Installing the package: Pkg.add("CSV.jl")

Using the package in code: using CSV

No third-party package installation required

Reading data

output = CSV.read("file.csv")

output = read("file.csv", String)

Convert

No additional conversion required.

Convert .csv data to an array of strings: lines = split(output, "\n")

Converting CSV lines to arrays of values: values = [split(line, ",") for line in lines]

Additional

Ability to configure read and write parameters.

Requires additional data processing to obtain data structure.

To work with popular formats we recommend to use the following Julia packages:

Category Format Julia Package Examples

Text files

TXT

Standard Library

I/O and Network

DOC/DOCX

DOCX.jl

PDF

PDFIO.jl

Spreadsheets

XLS/XLSX

XLSX.jl

Tutorial on XLSX.jl

Reading data from Excel and building models

CSV

CSV.jl

ODS

OdsIO.jl

Images

JPG/JPEG

Images.jl

Image Processing

PNG

GIF

TIFF

Scientific Data

CSV

CSV.jl

Data download and skip processing

TSV

MAT

MAT.jl

HDF5

HDF5.jl

NetCDF

NCDatasets.jl

FITS

FITSIO.jl

CDF

EmpiricalCDFs.jl

JLD2

JLD2.jl

Audio and Video

MP3

Audio-Video

Video Processing in Engee

Sound.jl for sound processing

WAV

AAC

MP4

AVI

MKV

Structured Information and XML

XML

EzXML.jl

EzXML.jl manual

XSD

XSLT

XSLT.jl

JSON

JSON

JSON.jl

Json.jl Github

If the table does not show the required format - please refer to Julia Packages or to the websites of the respective packages.