Click here to Skip to main content
14,665,555 members
Rate this:
Please Sign up or sign in to vote.
See more:
hi
want to ask, i have code in c# that produce xml file
i want to edit it to xls or csv to make it more readable
please kindly help me

sample code below

Quote:
internal static void SaveDefault()

{

using (XmlWriter writer = XmlWriter.Create(ConfigPath))

{

writer.WriteStartDocument();

writer.WriteStartElement("configuration");

writer.WriteString(Environment.NewLine);

writer.WriteStartElement("appSettings");

writer.WriteAttributeString("XsystemRootPath", "https://xsystem123.com");

writer.WriteAttributeString("XsystemUsername", "");

writer.WriteAttributeString("XsystemPassword", StringCipher.Encrypt("", "pasword"));

writer.WriteAttributeString("XsystemSavePassword", "false");

writer.WriteEndElement();

writer.WriteString(Environment.NewLine);

writer.WriteStartElement("reportSetting");

writer.WriteEndElement();

writer.WriteEndElement();

writer.WriteEndDocument();

}

Initialize(ConfigPath);

}


What I have tried:

i already try to change the extension it work but the format still like in XML
not separate bettween cell
Posted
Comments
johannesnestler 17-Mar-16 11:21am
   
hmm - so you constructed your XML "by Hand" - a little complicated, but why not.. what stops you to do the same, but write to a csv format (or more complicated an xls)? With "more readable" - you mean "better representation" in Excel? - or about what "reader" are you talking?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100