File format for .csv files, used for any read/write operations involving floating point data.
|
subroutine | csv_file_write (this, data, t) |
| Writes data to an output file.
|
|
subroutine | csv_file_write_vector (f, data, t) |
| Writes a vector_t object to an output file, in a row format. If the parameter t is present, it will be appended at the start of the row, followed by the contents of the vector.
|
|
subroutine | csv_file_write_matrix (f, data, t) |
| Writes a matrix_t object to an output file. If the parameter t is present, it will be appended at the start of each row.
|
|
subroutine | csv_file_read (this, data) |
| Reads data from an input file.
|
|
subroutine | csv_file_read_vector (f, vec) |
| Read a vector (i.e. data on a single row) from a csv file.
|
|
subroutine | csv_file_read_matrix (f, mat) |
| Read a matrix from a csv file.
|
|
subroutine | csv_file_set_header (this, hd) |
| Sets the header for a csv file. For example: hd = "u,v,w,p" .
|
|
integer function | csv_file_count_lines (this) |
| Count the number of lines in a file by going through it entirely until the end is reached.
|
|
◆ csv_file_count_lines()
◆ csv_file_read()
- Parameters
-
this | csv file in which to read. |
data | matrix_t or vector_t , will contain the read data. |
Definition at line 181 of file csv_file.f90.
◆ csv_file_read_matrix()
- Parameters
-
d | csv file from which to read. |
vec | Matrix object in which to store the file contents. |
- Note
- If the number of lines in the file is larger than the number of rows of
mat
, it will be assumed that a one-line header is present.
Definition at line 265 of file csv_file.f90.
◆ csv_file_read_vector()
- Parameters
-
d | csv file from which to read. |
vec | Vector object in which to store the file contents. |
- Note
- - Equivalent to reading a matrix with
nrows = 1
and ncols = N
. To read a vector in a column format, use a matrix_t
with ncols = 1
.
-
- If the number of lines in the file is larger than 1, it will be assumed that a one-line header is present.
Definition at line 236 of file csv_file.f90.
◆ csv_file_set_header()
- Parameters
-
- Note
- The header will be written "as is", meaning there will be no checks performed on the header separators, number of columns, etc.
Definition at line 295 of file csv_file.f90.
◆ csv_file_write()
- Parameters
-
this | csv file to write in. |
data | Data to write, can be vector_t or matrix_t. |
t | Time. |
Definition at line 65 of file csv_file.f90.
◆ csv_file_write_matrix()
- Parameters
-
f | csv file in which to write. |
data | Matrix to write. |
Time. | |
Definition at line 151 of file csv_file.f90.
◆ csv_file_write_vector()
- Parameters
-
f | csv file in which to write. |
data | Vector to write. |
Time. | |
- Note
- Equivalent to writing a matrix with
nrows = 1
and ncols = N
. To write a vector in a column format, use a matrix_t
with ncols = 1
.
Definition at line 120 of file csv_file.f90.