Hello everyone,
is there a command to import data from csv file and assign the values to variables?
Using Fish or Python?
I mainly use Python, so you can easily find help online. Look for “csv reader”, something like this:
import csv
with open('test.csv') as csv_file:
reader = csv.reader(csv_file, delimiter=',')
You can then loop through the reader variable.
Pandas is not supported with the software.
Thank you very much @sb_guido !
the documentation says external moduls can be installed:
’ It is possible to use most third-party Python extension modules with Itasca software. Extension modules can be installed with the pip
executable shipped with the program.’
A short video on how to install extension moduls would be very helpfull!
You can use Python:
In FISH see the intrinsics file.all and string.csv. from
http://docs.itascacg.com/flac3d700/common/fish/doc/fish_manual/fish_fish/file_utilities/fish_file.all.html#file.all
http://docs.itascacg.com/flac3d700/common/fish/doc/fish_manual/fish_fish/string_utilities/fish_string.csv.from.html#string.csv.from
To get a list of lists of string tokens from a CSV text file, for example
local mystrings = string.csv.from(::file.all(‘filename.txt’,‘text’))
You can then convert these tokens using the type construction functions, or use string.type() to examine the string and attempt to deduce a type.