cancel
Showing results for 
Search instead for 
Did you mean: 

Line Break in Mapper

cbot412
New Contributor II

 

I have this below code, but the output csv contains \n instead of giving line break

$id + '\n' + $crse_detail.toString().replace(/;/g, '\t\t').replace(/,/g, '\n') + '\n' + '**********' + '\n'

I tried updating the csv formatter delimiter to \n. It errored out saying line break can not be a delimiter.

Any suggestions?

1 ACCEPTED SOLUTION

endor_force
New Contributor III

I am guessing you do not actually want a csv output but some sort of text file, based on that the content should be separate lines and then each block separated with the stars?
If you have some other challenge please provide some sample input and maybe a mockup on what you expect out..

I think you will only need to map the line as in your code above but in order to output the text with line breaks you can join all lines with \n and then push it as binary out to a file. 
I have attached a sample for you to test with..

View solution in original post

2 REPLIES 2

endor_force
New Contributor III

I am guessing you do not actually want a csv output but some sort of text file, based on that the content should be separate lines and then each block separated with the stars?
If you have some other challenge please provide some sample input and maybe a mockup on what you expect out..

I think you will only need to map the line as in your code above but in order to output the text with line breaks you can join all lines with \n and then push it as binary out to a file. 
I have attached a sample for you to test with..

cbot412
New Contributor II

THANK YOU SO MUCH!!! This worked great!