Thank you to Nick and Amadou for their replies, and esp. Nick's concise
code. It gave what I wanted (as that, earlier, of Svend's). As an aside, I
have indeed replaced " " (i.e. missing data) with "." (i.e. 'period').
Apologies if this is a source of confusion/consternation.