Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2004
    Posts
    69

    Unanswered: editing txt files form VBA Access

    I'm wanting to import data into a table from the attached text file. I first want to delete all the unrelevent data from this text file though that is every thing up to the "TypeRI" string. Can any body give me some example code to open the text file and then delete every thing up to but not including the said string. Thankyou very much and Happy Christmas.
    Attached Files Attached Files

  2. #2
    Join Date
    Mar 2004
    Posts
    69

    Importing text files into acces which are Unicode

    I've hit on another problem. This text file is encoded using Unicode and if I try and use the
    DoCmd.TransferText acImportDelim , "tablename", "Filename",True
    command I get an error saying ';The field "some weird character" does not exsist in table. If I open my text file in note pad and resave it as ANSI then it imports ok. How do I go about automatically converting this text file from within access or allow it to be imported as I can't alter my import text file as its generated by a program I have no control over.
    Last edited by ISLMAN1975; 12-21-04 at 12:18.

  3. #3
    Join Date
    Mar 2004
    Posts
    69
    I've sorted my unicode import problem.
    I've created a specification which I use with the transfertext method so it now imports my text file sucsessfully.

    All I need to do now is edit my original text file to delete everything up to TypeRI. Then I need to save it and then I can use the TransferText method to import the data.
    When I open the text file in access how do I select every thing up to the TypeRI text and then delete it. Then resave the file. Is this possible.
    Attached Files Attached Files

Posting Permissions

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