help with a csv file

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • daisy72
    New Member
    • Nov 2006
    • 1

    #1

    help with a csv file

    hi there i have amde a script that scrapes the data from a file then strips the html tags from it and outputs in it the form

    1. first part of the set
    1. second part of set 1
    etc

    using the console.writeli ne

    i.e

    Console.WriteLi ne(_rowCount + "\t" + thechar.Unicode Number);
    Console.WriteLi ne(_rowCount + "\t" + thechar.Utfvalu e);
    Console.WriteLi ne(_rowCount + "\t" + thechar.Name);
    Console.WriteLi ne(_rowCount + "\t" + thechar.Htmlcha r);
    Console.WriteLi ne(_rowCount + "\t" + thechar.Htmlenc od);

    instead of writing this to the console i want to write this to a csv file in the form

    thechar.Unicode Number, thechar.Utfvalu e, thechar.Name, thechar.Htmlcha r, thechar.Htmlenc ode [newline]

    it wont have any headers but just sinple rows of data in the csv

    can anyone help me with this please

    daisy
  • dotexe
    New Member
    • Oct 2006
    • 13

    #2
    Namespace:
    Code:
    system.IO
    try some thing like this

    Code:
    StreamWriter _filename = new StreamWriter(@"filename.csv");
    	_filename.Write(thechar.UnicodeNumber+",");

    Comment

    Working...