use sscanf and strstr to parse text