dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: How to Write data into .csv in C#?

  1. #1
    Join Date
    Dec 2014
    Posts
    1

    How to Write data into .csv in C#?

    How to write data into csv file row by row by using c#?

    Thank you.

  2. #2
    Join Date
    Jun 2015
    Posts
    1

    Re: How to Write data into .csv in C#?

    StringBuilder sb = new StringBuilder();

    for (int i = 0; i < 100; i++)
    {
    for (int j = 0; j < 100; j++)
    {
    sb.AppendFormat("{0}-{1},", i.ToString(), j.ToString());
    }
    sb.Remove(sb.Length - 1, 1);
    sb.AppendLine();
    }

    System.IO.File.WriteAllText("c:\\users\\s.russo\\desktop\\asd.csv", sb.ToString());


    -----------------------------------------------------------

    Free .NET WORD library supporting editing and conversion of Word files.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)