Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. CSV File

CSV File

Scheduled Pinned Locked Moved C#
csharphelptutorial
7 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    senthilsstil
    wrote on last edited by
    #1

    Hi Friends, How to retreive values from .CSV file in C#.Please help me how to do. Thanks & Regards Senthil Kumar.T.S

    C V L 3 Replies Last reply
    0
    • S senthilsstil

      Hi Friends, How to retreive values from .CSV file in C#.Please help me how to do. Thanks & Regards Senthil Kumar.T.S

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      File.ReadAllText and then the split method to split the string on the , so you get an array of values to parse.

      Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

      S 1 Reply Last reply
      0
      • S senthilsstil

        Hi Friends, How to retreive values from .CSV file in C#.Please help me how to do. Thanks & Regards Senthil Kumar.T.S

        V Offline
        V Offline
        Vikram A Punathambekar
        wrote on last edited by
        #3

        In addition to what CG said, there are quite a few libraries that do this. If you want to do it yourself, make sure you handle cases like the items being enclosed in double quotes. I always do that so I can have spaces and other special characters (including the comma itself) in my items.

        Cheers, Vikram.


        The hands that help are holier than the lips that pray.

        S 1 Reply Last reply
        0
        • C Christian Graus

          File.ReadAllText and then the split method to split the string on the , so you get an array of values to parse.

          Christian Graus Please read this if you don't understand the answer I've given you "also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )

          S Offline
          S Offline
          senthilsstil
          wrote on last edited by
          #4

          Hi Christian Graus, Can you give me a example? Please?

          1 Reply Last reply
          0
          • S senthilsstil

            Hi Friends, How to retreive values from .CSV file in C#.Please help me how to do. Thanks & Regards Senthil Kumar.T.S

            L Offline
            L Offline
            Laddie
            wrote on last edited by
            #5

            Intrestingly you can use ADO.Net to deal with reading CSV files. http://weblogs.asp.net/fmarguerie/archive/2003/10/01/29964.aspx[^]

            Thanks Laddie Kindly rate if the answer was helpful

            G 1 Reply Last reply
            0
            • V Vikram A Punathambekar

              In addition to what CG said, there are quite a few libraries that do this. If you want to do it yourself, make sure you handle cases like the items being enclosed in double quotes. I always do that so I can have spaces and other special characters (including the comma itself) in my items.

              Cheers, Vikram.


              The hands that help are holier than the lips that pray.

              S Offline
              S Offline
              senthilsstil
              wrote on last edited by
              #6

              Hi Friends, Can you tell me how to connect .CSV file with C# and retreive the values.As CG said by File.ReadAllText we can split the string and get the method.Can give me a example code so that i can get an idea, because i searched in google but i can't get the solution. Thanks & Regards Senthil Kumar.T.S

              1 Reply Last reply
              0
              • L Laddie

                Intrestingly you can use ADO.Net to deal with reading CSV files. http://weblogs.asp.net/fmarguerie/archive/2003/10/01/29964.aspx[^]

                Thanks Laddie Kindly rate if the answer was helpful

                G Offline
                G Offline
                Giorgi Dalakishvili
                wrote on last edited by
                #7

                There is a special CSV reader too for Ado.Net A Fast CSV Reader[^]

                Giorgi Dalakishvili #region signature my articles #endregion

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups