Skip to content

Instantly share code, notes, and snippets.

@nVlast
nVlast / csvtoxml.cs
Last active March 23, 2016 10:33
Convert csv file to xml
public static void ToXml(string srcFilepath, string dstFilepath, string rootNodeName, string elementNodeName)
{
using (var parser = new Microsoft.VisualBasic.FileIO.TextFieldParser(srcFilepath))
using (XmlTextWriter writer = new XmlTextWriter(dstFilepath, Encoding.UTF8))
{
parser.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited;
parser.SetDelimiters(new string[] { "," });
string[] headers = parser.ReadFields();
@nVlast
nVlast / 0_reuse_code.js
Created October 1, 2015 16:19
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console