Results 1 to 6 of 6
  1. #1
    Join Date
    Dec 2002
    Location
    Columbus, GA
    Posts
    81

    Unanswered: Deleteing First 2 rows on imported Data

    I am importing a txt file through access.

    I have tried editing the file export options but cant get it to delete these lines.

    I am exporting data from a program into a txt file. The report automatically puts the first line as a date range the second line is bloank and the 3rd line starts the data. (I am able to NOT export the headings).

    So it looks like "witout the ----"
    ---------------------------------------------------------------------
    01/01/01 - 01/02/01

    '0000000' 'James Johnson' 'Address' 'city' 'st' 'zip' 'phone'
    ---------------------------------------------------------------------
    The data is continous after that, its just those 2 first lines.

  2. #2
    Join Date
    Jan 2003
    Posts
    4

    Post

    Isn't there a place in the import wizard that asks what line you want to start importing at? There should be. You should specify line 3 there.
    What version of Access are you running?

    Chris

  3. #3
    Join Date
    Dec 2002
    Location
    Columbus, GA
    Posts
    81
    I am running 2000 on this DB

    The import wizard does not show a starting line. Now this data does not have text seperators so I am having to import using the fixed width. I can shoose vertical line breaks but cannot choose horizontal line breaks.

  4. #4
    Join Date
    Nov 2002
    Posts
    150
    Not pretty but you could import the text file into a temp table, run a query to delete the first 2 rows, and then import the temp table into your data table.

    or....

    write a function that opens the text file and deletes the first 2 lines.

  5. #5
    Join Date
    Jan 2003
    Posts
    4

    Angry

    Bummer, now I see what you are talking about. I thought you could tell it. Maybe I was thinking of Excel's import wizard.
    How do you feel about doing it with code?
    http://www.stamey.nu/vbanswernetwork...oMDBWithVB.asp

    Chris

  6. #6
    Join Date
    Dec 2002
    Location
    Columbus, GA
    Posts
    81
    I went in and created a macro that imports the data into a new table, uses selectrow and deletes the first row and then repeats itself to delete teh second row and it works for me. Thanks.

Posting Permissions

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