Read text and extract it to array