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. Parse CSV

Parse CSV

Scheduled Pinned Locked Moved C#
databaseregexhelp
3 Posts 3 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.
  • J Offline
    J Offline
    jebin k
    wrote on last edited by
    #1

    I need to parse a CSV file and match it with the first line of CSV with my table field. (eg:) My first line of Csv file will be like this Venue Event Date Cost Quantity Notes my database table fields will be Venue Event Date Notes Quantity Cost. I need to match because the order of CSV file will change . Can any one help me to match fields. My table fields and Csv fields will be same only. Pardon me if my presentation is wrong. Thanks in advance.

    V O 2 Replies Last reply
    0
    • J jebin k

      I need to parse a CSV file and match it with the first line of CSV with my table field. (eg:) My first line of Csv file will be like this Venue Event Date Cost Quantity Notes my database table fields will be Venue Event Date Notes Quantity Cost. I need to match because the order of CSV file will change . Can any one help me to match fields. My table fields and Csv fields will be same only. Pardon me if my presentation is wrong. Thanks in advance.

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

      When you have the fields in the file, surely you should be able to iterate over them and match them with those in the DB?

      Cheers, विक्रम


      And sleep will come, it comes to us all And some will fade and some will fall

      1 Reply Last reply
      0
      • J jebin k

        I need to parse a CSV file and match it with the first line of CSV with my table field. (eg:) My first line of Csv file will be like this Venue Event Date Cost Quantity Notes my database table fields will be Venue Event Date Notes Quantity Cost. I need to match because the order of CSV file will change . Can any one help me to match fields. My table fields and Csv fields will be same only. Pardon me if my presentation is wrong. Thanks in advance.

        O Offline
        O Offline
        originSH
        wrote on last edited by
        #3

        You can use ADO.Net with ODBC to read a CSV file just like you would a database :) http://www.c-sharpcorner.com/UploadFile/mgold/ConnectODBCText11262005070206AM/ConnectODBCText.aspx[^]

        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