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. Database & SysAdmin
  3. Database
  4. CSV to Tab Delimiter file

CSV to Tab Delimiter file

Scheduled Pinned Locked Moved Database
databasecsharpasp-netsql-serversysadmin
2 Posts 2 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.
  • Y Offline
    Y Offline
    Yong Yau
    wrote on last edited by
    #1

    I am developing a system using ASP.NET with VB script. I have a function to import CSV file into my SQL server database. As i found out the comma will effect my data placement in my tables, so i think of to develop a function to convert the CSV file to Tab Delimiter file. Is it possible to develop the function? As i found out, there are many converter outside that need to buy for the converter, it is not convenient for me to buy it. Please give me any suggestion or solution, thank you.

    M 1 Reply Last reply
    0
    • Y Yong Yau

      I am developing a system using ASP.NET with VB script. I have a function to import CSV file into my SQL server database. As i found out the comma will effect my data placement in my tables, so i think of to develop a function to convert the CSV file to Tab Delimiter file. Is it possible to develop the function? As i found out, there are many converter outside that need to buy for the converter, it is not convenient for me to buy it. Please give me any suggestion or solution, thank you.

      M Offline
      M Offline
      Mike Dimmick
      wrote on last edited by
      #2

      Well, your problem here is that your import data is ambiguous. You don't know whether a comma represents a field separator or a digit grouping symbol. The best thing to do is to change the import data format, for example to put quotes around numeric fields that can have a digit grouping symbol in them, or indeed to put quote marks around all fields. It's then traditional to double quote marks that actually appear within a field. Bulk insert is typically easiest to handle with fixed field widths rather than the use of separators. There's what looks to be a good CSV file reader class at http://www.codeproject.com/cs/database/CsvReader.asp[^] (disclaimer: I haven't used it). You could use this to write a convertor to tab-separated format once you've sorted out the ambiguity, if you can't get the source data generated in a usable format.

      Stability. What an interesting concept. -- Chris Maunder

      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