next_row Subroutine

private subroutine next_row(me)

Advance to the next row in the CSV file (write any blank cells that are necessary to finish the row)

Type Bound

csv_file

Arguments

Type IntentOptional Attributes Name
class(csv_file), intent(inout) :: me

Called by

proc~~next_row~~CalledByGraph proc~next_row csv_file%next_row proc~add_matrix csv_file%add_matrix proc~add_matrix->proc~next_row none~add csv_file%add proc~add_matrix->none~add none~add->proc~add_matrix proc~add_vector csv_file%add_vector none~add->proc~add_vector proc~add_vector->none~add

Source Code

    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