2

I am looking for some thing like .Net utility which allows you to export data/object to .csv and similarly read that data. Same like we have a concept of xmlSerialization.

Thanx

3
  • 1
    CSV is a very limited format in that it is rigidly 2-dimensional; this would work for an homogeneous list of shallow objects, but won't work if there are any association properties etc Commented Jun 15, 2011 at 8:46
  • What kind of look do you want for your output, BreakHead? I mean, if you have an object with properties and those probperties are objects with properties, what should that look like in your CSV? Commented Jun 15, 2011 at 8:51
  • @Matt, that's why I posted this question, because I dnt have to worry about pattern they will stored in .csv, same as in xmlserialization the xml we get manage all object having property as object. Commented Jun 15, 2011 at 9:02

3 Answers 3

2

Have you tried SimpleCSV? (codeplex project)

Sign up to request clarification or add additional context in comments.

Comments

1

I think it would be quicker and easier to write your own parser for this purpose. All you need to do is create a text file and append it with all the parameters of your object separated by a delimiter (";").

When you are reading it back in you will know the order of the parameters that are coming in and how they are separated so you can create a new object and convert the strings into their appropriate types and apply these values to your new object.

2 Comments

Not a problem, hope it goes well!
Is there as specific reason you need csv format why not serialize the object instead which save the memory state of the object
0

You can easily write your own serializer/parser using the String.Join and String.Split methods.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.