Results 1 to 2 of 2
  1. #1
    Join Date
    Mar 2003
    Posts
    11

    Question Unanswered: Import CSV but splitting the import data into two tables

    I have a .CSV file with has two sets of data, for example:

    "CustomerID","CustomerName","CustomerAddress"
    132,"J Blog","1 London Street,London"
    "ProductID","ProductName","Qty"
    10056,"13A Socket",3
    10008,"Plugs",1


    Brake down of the file:

    -------------------------------------------------
    Customer Information:

    "CustomerID","CustomerName","CustomerAddress"
    132,"J Blog","1 London Street,London"

    Bought:

    "ProductID","ProductName","Qty"
    10056,"13A Socket",3
    10008,"Plugs",1
    -------------------------------------------------

    What I would like to do is select the csv file and run a script which will import the data in the file - BUT (here is the bit I don’t know would work) - I would like to put the Customer Information data in one table and the things that customer has bought in another table.

    So…what I was thinking: is it possible to put some sort of a FLAG at the end of the Customer Information data in the CSV file - so when running the import script - the script imports the first bit of data into one table and then when it see this FLAG imports the rest of the data into another table.

    Is this possible, if so how would I go about it????

    Thanks in advance.

    Wilhelm

  2. #2
    Join Date
    Mar 2003
    Location
    Romania
    Posts
    32
    You can import the CSV in one temporary table and build two append queries that puts the data in your tables.
    Florin Profeanu
    floreanuprofin@yahoo.com

Posting Permissions

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