Skip to content

Instantly share code, notes, and snippets.

Created May 9, 2017 17:16
Show Gist options
  • Save anonymous/7af6c56585303bf2946525d736a5e989 to your computer and use it in GitHub Desktop.
Save anonymous/7af6c56585303bf2946525d736a5e989 to your computer and use it in GitHub Desktop.
TryCF Gist
<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