Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2008

    Unanswered: Import multiple files by file date order then update and append

    Hi all

    I hope you can help, I have done a search on forums however cant see to find what im looking for.

    I have 430 text files that I need to import to a table and more to follow , however I need it todo the following.

    1: import text files in date order each filename has the following format

    RefDeb20051202 "RefDebyyyymmdd"

    2: for each file imported it needs to update data that is already there but also append data that is not there.

    file format

    For June text file RefDeb20080601

    12345, / / , je9999999d, Homer, simpson "not supplied DOB & wrong NI"

    For july text file RefDeb20080701

    12345, 07/09/1978, je322899d, Homer, simpson "theres an update to DOB and update to NI"
    23456, 11/11/1988, tw522893c, Steve, simpson " New record"

    all files are in the same format to import, I could use field 1 which is a unique reference number to check if it needs to updated.

    any thoughts on the best way todo this would be great, thanks all.

  2. #2
    Join Date
    Jun 2007
    Maitland NSW,Australia
    Assuming that you know the order for importing the files. I would import file 1 into a temporary table. Then append this temporary table to another table e.g. table_data using the field 1 as the primary key. Now we must assume that there maybe more than one record for a value in field 1, so we must update the table_data with the data in our temporary table.

    For each other file we need to delete the temporary table then import, append and update.

Posting Permissions

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