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:
Purpose | Function | Description |
---|---|---|
Open |
opens a file or data stream |
|
determines whether the object (stream or timer) is already closed or not. |
||
Close |
closes an I/O stream |
|
closes all open GUI windows |
||
closes only the read-from-file thread associated with the I/O object |
||
stops writing half of a full-duplex stream |
||
Write |
writes a canonical binary file representation of a value to the specified I/O stream or file |
|
checks if writing to the specified object is supported |
||
Read |
reads the contents of a file |
|
reads binary data from an I/O stream or file, filling the data matrix. |
||
reads available buffered data from a stream |
||
performs a read of at most nb bytes from stream to b, returning the number of bytes to be read |
||
reads the entire file as a string and removes one line break character at the end (if any). |
||
returns names in the directory (dir) or the current working directory if not specified. |
||
returns an iterated object resulting in read(io, T) |
||
reads a single line of text from a given I/O stream or file. |
||
reads all lines in an IO stream or file as vector or string values |
||
returns the target location pointed to by a path symbolic link |
||
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: Using the package in code:
|
No third-party package installation required |
Reading data |
|
|
Convert |
No additional conversion required. |
Convert .csv data to an array of strings:
Converting CSV lines to arrays of values:
|
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 |
|
DOC/DOCX |
|||
Spreadsheets |
XLS/XLSX |
||
CSV |
|||
ODS |
|||
Images |
JPG/JPEG |
||
PNG |
|||
GIF |
|||
TIFF |
|||
Scientific Data |
CSV |
||
TSV |
|||
MAT |
|||
HDF5 |
|||
NetCDF |
|||
FITS |
|||
CDF |
|||
JLD2 |
|||
Audio and Video |
MP3 |
||
WAV |
|||
AAC |
|||
MP4 |
|||
AVI |
|||
MKV |
|||
Structured Information and XML |
XML |
||
XSD |
|||
XSLT |
|||
JSON |
JSON |
If the table does not show the required format - please refer to Julia Packages or to the websites of the respective packages. |