Created
July 9, 2019 05:49
-
-
Save surajp/c14c9ec7f5e534cbb605b5d90f8e53d5 to your computer and use it in GitHub Desktop.
Escape new line character within the same row in csv
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const cleanFunction = arr=>arr.reduce((clean,current)=>{current.replace(/[^(?<!\\)"]/g,"").length%2>0?clean+=current+"\\n":clean+=current+"\n";return clean},"").replace(/\\n$/,'') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment