general function for parsing received text values