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. How to read txt file and open DataBase

How to read txt file and open DataBase

Scheduled Pinned Locked Moved C#
tutorialdatabasehelpquestion
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.
  • A Offline
    A Offline
    Admin887
    wrote on last edited by
    #1

    Heloo, How can i read a specific txt file and open a new 'mdb' file that will contain some things that the file has. For instance, The File contains: 00000 33333 22222 11111 ID=32 Name=Fox DATE=040208 33333 33333 33333 33333 Number=45 Add=LA Cell=12345678 22222 11111 22222 11111 ID=12 Name=LOLA DATE=020207 and so on.... i want to create a new mdb file that will contain a specific columns (ID,NAME,DATE,NUMBER,ADD,CELL).. i want that the comp will read the file and ignore the numbers(on the first line,on the third line and on the fifth line) and the comp will add a new line for the mdb file(for example: gil.mdb) it will very help me.. it is for my HUGE project.. thank you very much..

    S 1 Reply Last reply
    0
    • A Admin887

      Heloo, How can i read a specific txt file and open a new 'mdb' file that will contain some things that the file has. For instance, The File contains: 00000 33333 22222 11111 ID=32 Name=Fox DATE=040208 33333 33333 33333 33333 Number=45 Add=LA Cell=12345678 22222 11111 22222 11111 ID=12 Name=LOLA DATE=020207 and so on.... i want to create a new mdb file that will contain a specific columns (ID,NAME,DATE,NUMBER,ADD,CELL).. i want that the comp will read the file and ignore the numbers(on the first line,on the third line and on the fifth line) and the comp will add a new line for the mdb file(for example: gil.mdb) it will very help me.. it is for my HUGE project.. thank you very much..

      S Offline
      S Offline
      Saksida Bojan
      wrote on last edited by
      #2

      System.IO.StreamReader sr = new System.IO.StreamReader("c:\\1.txt");
      String Line = sr.ReadLine();

      And Look for String.Split to split string to array based on entry. And using String.Substring to get specific chars of specific lenght. You need to manualy create parser to intercept and convert it to your DB writer

      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