There is a formatted txt file that my java program reads and sends over the contents as a string to front-end.
The string that is sent to front end looks like this:
var result = "This is the result.\nIt contains some details\n\nDetails are as follows\nabc,xyz"
This is the result.
It contains some details
Details are as follows
$('#divId').html("<pre>" + result + "</pre>");