Results 1 to 5 of 5
  1. #1
    AndrewAfresh is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2006
    Posts
    21

    Importing tab delimited files without spec


    Is there any way to use docmd.transfertext to import tab delimited files without specifying an import spec? I can’t use specs as I receive many files to import with different columns in each. I want to import these files to one table, do some reporting on it, delete the table and then do the next file.

  2. #2
    orange's Avatar
    orange is offline Moderator
    Windows XP Access 2003
    Join Date
    Sep 2009
    Location
    Ottawa, Ontario, Canada; West Palm Beach FL
    Posts
    16,743

  3. #3
    Rawb is offline Expert
    Windows 7 64bit Access 2010 32bit
    Join Date
    Dec 2009
    Location
    Somewhere
    Posts
    875
    Not using DoCmd.TransferText.

    The only way I know of to do this is to write a VBA Function to import the file. I've had to do something like this before though, and it's not really all that hard. In fact, the only real issue I ran into was knowing when to import double quotes and when not to.

    Or you could re-save the file as an spreadsheet in an Excel Workbook and then import that. If you're dealing with a lot of file though, you'll probably want to come up with a way of batch saving the files so you don't have to manually do it one file at a time.

  4. #4
    JoeM is offline VIP
    Windows XP Access 2007
    Join Date
    Jun 2012
    Posts
    3,904
    I did some playing around, and I think I found one way to get it to work with the TransferText option, but it may not work for you.

    First determine the most number of columns your file may have. Then create a table that has that many columns, and format them all the same (probably to Text).
    Then, import your file with the most columns and create your Import Specification off of that.
    Then any file that has that many columns, or less, should be able to be imported using TransferText with the Import Specification you set up.

    The downside is that all your field values will be the same format (i.e. Text), so if you really have a mixture of text, number, and date fields (that you really need formatted differently for your report purposes), you would need to do some data conversions after your import.

  5. #5
    AndrewAfresh is offline Novice
    Windows XP Access 2003
    Join Date
    Jun 2006
    Posts
    21
    Thank you very much, I shall investigate the options you suggest

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Importing .txt (tab delimited) file into Access 2007
    By bcn1988 in forum Import/Export Data
    Replies: 1
    Last Post: 12-03-2012, 12:03 PM
  2. Replies: 7
    Last Post: 11-20-2012, 05:08 PM
  3. Importing Text Delimited
    By BLD21 in forum Import/Export Data
    Replies: 2
    Last Post: 05-06-2011, 10:23 AM
  4. Replies: 1
    Last Post: 07-31-2010, 08:04 AM
  5. Importing a tab delimited file into access table - please he
    By championss in forum Import/Export Data
    Replies: 0
    Last Post: 10-29-2006, 02:33 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums