Advance to the next row in the CSV file (write any blank cells that are necessary to finish the row)
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(csv_file), | intent(inout) | :: | me |
subroutine next_row(me) implicit none class(csv_file),intent(inout) :: me integer :: i !! counter integer :: n !! number of blank cells to write if (me%icol>0) then n = me%n_cols - me%icol do i=1,n if (i==n) then !no trailing delimiter if (me%enclose_strings_in_quotes) then write(me%iunit,'(A)',advance='NO') me%quote//me%quote end if else if (me%enclose_strings_in_quotes) then write(me%iunit,'(A)',advance='NO') me%quote//me%quote//me%delimiter else write(me%iunit,'(A)',advance='NO') me%delimiter end if end if end do write(me%iunit,'(A)') '' ! new line end if me%icol = 0 ! this row is finished end subroutine next_row