Created
May 9, 2017 17:16
-
-
Save anonymous/7af6c56585303bf2946525d736a5e989 to your computer and use it in GitHub Desktop.
TryCF Gist
This file contains 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
<cfscript> | |
// CSV content | |
csvContent = '"John Doe","New York","No garlic, onions, or nuts","Yes","No"'; | |
// Replace all comma in between with dash | |
writeOutput( | |
csvContent.replaceAll( | |
',(?!")|(?<!"),(?=[^"]*?"(?:,|\r?\n|\r|$))', '-' | |
) | |
); | |
</cfscript> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment