Reading contents in a text file

Results 1 to 2 of 2

Thread: Reading contents in a text file

  1. #1
    Join Date
    Dec 1969

    Default Reading contents in a text file

    Hi,<BR><BR>i have got a text file in which there are multiple colums of data with the column heading. <BR><BR>i want to store the contents of the file in a database with the heading as the filed names.<BR><BR>will it be possible?

  2. #2
    Join Date
    Dec 1969

    Default RE: Reading contents in a text file

    Yes... You have several options.<BR><BR>The first would be to IMPORT the data. If you&#039;re using Access or SQL Server it&#039;s very straight forward to use their wizards to import standard delimited data.<BR>If you&#039;re using other DBMS&#039;s (MySQL/Oracle/etc) it&#039;s possible, but can be a bit harder to get the data into an acceptable format.<BR>Either way, the help files for your DBMS will be able to help you.<BR><BR>The second way is to use the Microsoft Text Driver or Microsoft Jet Driver to manually query the text file as if it was an ODBC data source. You could then pull the data out and push it into your other database...<BR><BR>The third method is to read the file in using the FileSystemObject, split it by line breaks (vbcrlf), then by tabs (or whatever you&#039;re using to delimit the fields), and then iterate through your array putting the data into your new database...<BR><BR>Neither of these three are particuarly hard, and I suggest you try them in the order I gave. Using the wizards is definately the easiest way.<BR><BR>Craig.<BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts