Return third blank-separated word of header line, blank if none.
Not read list-directed, which would end unit at a /.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| character(len=*), | intent(in) | :: | line |
Header line. |
pure function third_word(line) result(w) !! Return third blank-separated word of header line, blank if none. !! !! Not read list-directed, which would end unit at a `/`. ! Arguments character(len=*), intent(in) :: line !! Header line. character(len=len(line)) :: w integer(int32) :: k, p w = adjustl(line) do k = 1, 2 p = index(trim(w), ' ') if (p == 0) then w = '' return end if w = adjustl(w(p:)) end do p = index(w, ' ') if (p > 0) w = w(1:p - 1) end function third_word