Convert data in text file to JSON