Open
Description
Here is the test CSV file:
foo,bar
1.0,2.0
,4.0
5.0,
7.0,
And with following codes:
program test
use csv_module
implicit none
type(csv_file) f
logical status_ok
character(10), allocatable :: columns(:)
integer i
real(8), allocatable :: x(:)
call f%read('test.csv', header_row=1, status_ok=status_ok)
print *, 'status_ok =', status_ok
call f%get_header(columns, status_ok)
print *, 'status_ok =', status_ok
print *, columns
call f%get(1, x, status_ok)
print *, 'status_ok =', status_ok
do i = 1, size(x)
print *, x(i)
end do
end program test
The output is:
status_ok = T
status_ok = F
foo bar
status_ok = T
1.00000000000000
0.000000000000000E+000 ! <-- Assume this should be missing value
5.00000000000000
7.00000000000000
As you can see, the second value is expected to be missing value, but I got 0.000000000000000E+000
, which may cause difficulty to judge whether the value is valid or not. Can we specify the missing value when get as:
call f%get(1, x, missing_value=99999.0, status_ok=status_ok)