Click here to Skip to main content
15,900,511 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900