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. FileMode.Create?

FileMode.Create?

Scheduled Pinned Locked Moved C#
databasetutorialquestion
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.
  • S Offline
    S Offline
    scotlandc
    wrote on last edited by
    #1

    Hi, I've got to import a collection of text files into a database, the collection being anywhere between 3 and 20 files in size. A typical collection would look like 1 x AD?????????.txt 1 x LB?????????.txt ? x PL?????????.txt There can be anywhere between 1 and 20 PL files at any one time. I'm wondering on what the best way is to deal with the files with multiple versions, ie the PL files. Is it better to create a new file and append all of the text from the PL files into it before import? If so, how? I know there is a FileMode.Create method but am unsure as how to use it. Any tips on this or suggestions on a better approach would be greatly welcomed. Thanks a lot Scott

    E 1 Reply Last reply
    0
    • S scotlandc

      Hi, I've got to import a collection of text files into a database, the collection being anywhere between 3 and 20 files in size. A typical collection would look like 1 x AD?????????.txt 1 x LB?????????.txt ? x PL?????????.txt There can be anywhere between 1 and 20 PL files at any one time. I'm wondering on what the best way is to deal with the files with multiple versions, ie the PL files. Is it better to create a new file and append all of the text from the PL files into it before import? If so, how? I know there is a FileMode.Create method but am unsure as how to use it. Any tips on this or suggestions on a better approach would be greatly welcomed. Thanks a lot Scott

      E Offline
      E Offline
      ednrgc
      wrote on last edited by
      #2

      Are you creating these files, or just importing them into the database? If it's an import, just traverse through the directory and get the files that match your file mask, and import them one at a time. It seems like a longer process to concatenate the files. In the case of an error, you will know exactly which file caused the exception when they are imported separately.

      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