Skip to content

Instantly share code, notes, and snippets.

@thesowah
Last active August 29, 2015 14:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thesowah/8c08e45da4ec34233367 to your computer and use it in GitHub Desktop.
Save thesowah/8c08e45da4ec34233367 to your computer and use it in GitHub Desktop.
Fixes error in parsing XML to excel worksheet [ASP.NET C#]
Using Notepad++ search and replac all the illegal characters in XML file
//#1 All cells with whitespace and chars like '&' but start with alphabets
Find: <Data ss:Type="String">([a-zA-Z]+(.+))</Data>
Replace: <Data ss:Type="String"><![CDATA[$1]]></Data>
//#2 All empty cells
Find: <Data ss:Type="String">*</Data>
Replace: <Data ss:Type="String"><![CDATA[-]]></Data>
//#3 Done!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment