The text of line after its first n fields (separated by blanks or
tabs), trimmed: a star's name ('' if none: e.g. without a color index).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | line |
a line of the star catalog |
||
| integer, | intent(in) | :: | n |
fields skipped |
pure function after_fields(line, n) result(rest) character(len=*), intent(in) :: line !! a line of the star catalog integer, intent(in) :: n !! fields skipped character(len=:), allocatable :: rest character(len=*), parameter :: blanks = ' '//achar(9)//achar(13) integer :: i, j, k rest = '' i = 1 do k = 1, n j = verify(line(i:), blanks) ! the field's start if (j == 0) return i = i + j - 1 j = scan(line(i:), blanks) ! the blank after it if (j == 0) return i = i + j - 1 end do j = verify(line(i:), blanks) ! the rest, without blanks around it if (j == 0) return i = i + j - 1 k = verify(line, blanks, back=.true.) rest = line(i:k) end function after_fields