Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2006
    Posts
    1

    Unanswered: automatic .txt import problem

    Hi All,

    i am trying to automate the import of a .txt file on a daily basis which is fine if the .txt file is always the same name. the problem i have is the file which i want to import is date and time stamped:

    example
    zeil060803210140.txt

    this file was created on the 3d august 06 at 21:01:40

    i have set the file up to automatically pick up the date but hoe can i imprt the file by stripping out the time stamp?

    are there any wildcards that can be used?

    ie

    zeil060803*.txt

    thanks in anticipation

  2. #2
    Join Date
    Nov 2003
    Posts
    1,487
    There are a lot of ways you can do this I suppose but off hand I would most likely do things this way:

    - Create a Folder (directory) where all the Import text files are to be held;

    - Create a DB table that will hold the names of already processed (imported) text files. Table fields might be something like: ImportDateTime (Date/Time); TextFileName (Text); Successfull (Yes/No)

    - Search the folder for new text files (compare file names to those already stored in table);

    - Place any new files found in folder, that are not already named in table, into an Array;

    - Enumerate through the Array and process (import) each text file ensuring that each file processed (imported), the date/time and name is automatically inserted into the DB Table and with each text file successfully processed, the Successfull field is also set to True.

    Optional:
    - When all processing has completed then display two ListBoxes based of the DB table. List one the left displays successfull imports and the list on the right displays unsuccessfull imports.

    If you provide the current routine you are using I will incorporate this method into it.

    .
    Environment:
    Self Taught In ALL Environments.....And It Shows!


Posting Permissions

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