LF's in CSV to result in a Multi-Line Cell in Excel
Could use some advice here. I am trying to take a string of data (a group of key/value pairs) that is comma delimited and insert it into a single Excel cell so that it shows as multiple lines within the cell.
For example, I have a data string that looks like this:
dataString == “key1:value1, key2:value2, key3, value3”
When I open my CSV file in Excel, I want the cell that holds this string to look like this:
key1:value1
key2:value2
key3:value3
In my attempt to do achieve this formatted cell, I’m using a mapper that has the following expression.
$dataString.replace(/,/g, /\n/)
I am expecting the commas to be replaced with line feed regex characters, but instead what I see in Excel looks like this:
key1:value1/\n/key2:value2/\n/key3:value3
I feel as though the CSV formatter is not recognizing the escape characters and resolving the \n into a line feed. That’s just a guess because I’ve tried many things, but unsuccessfully. Can anyone help?