Results 1 to 4 of 4
  1. #1
    mykonosman is offline Novice
    Windows XP Access 2003
    Join Date
    Jan 2012
    Posts
    1

    Importing TXT from non-Access export....can't read Layout

    Would anyone be able to help me read and convert the attached file layout so that I can import the file into Access 2003. The file was exported from a non-Access database system. I have attached a very small extract of the TXT file if that helps.

    Thanks.

  2. #2
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    I have done something like this in the past. I won't be able to look for the code until I get home.

    Is the is a one time thing?
    Do you have a table set up for this data? If you do, please ensure it is in A2000 format and post it, please.

  3. #3
    ssanfu is offline Master of Nothing
    Windows 2K Access 2000
    Join Date
    Sep 2010
    Location
    Anchorage, Alaska, USA
    Posts
    9,664
    More info.

    You can use a table or code it into an array. You would store the field starting column and the length for each field in the "extract file layout". For example the first field is skipped (unused). So the first entry would be 2 for the column, 2 for the length. Then 4 for the column, 9 for the length.... then the code would be something like:

    Code:
    DO UNTIL EOF
       Read a line from the text file into a variable
    
       For i = 1 to 18 ' there are 4 unused fields
          'read the starting column and length into variables. 
          'use the MID() function to get the sub-string from the input string
          'update the table
       Next
    
    LOOP
    After looking at the layout, why does the Key, Block, Block-N all start at column 4? Hmmmmm....Very strange.....


    So you can see that it is fairly simple. Make sure to add error checking.

  4. #4
    David04845 is offline Novice
    Windows XP Access 2007
    Join Date
    Feb 2012
    Posts
    16
    open it in note pad then go to edit and replace

    replace " " one space bar press with , then hit replace all.. wait for it to go through the entire document.

    then import the file into excel using , as the delim and mark treat consecutive delim's as one.

    you will have some minor cleanup left because of some of the long addresses but you can sort view the cells and clean it up pretty quick for import.

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

Similar Threads

  1. Access 2007, all subforms read-only
    By Merganser in forum Forms
    Replies: 1
    Last Post: 07-27-2011, 10:53 PM
  2. export with formatting & layout preserves truncations??
    By yinchiao in forum Import/Export Data
    Replies: 0
    Last Post: 04-05-2010, 12:38 PM
  3. Read only Access Database
    By Rameez in forum Access
    Replies: 7
    Last Post: 06-23-2009, 12:30 AM
  4. Export data as text for layout
    By Debby in forum Import/Export Data
    Replies: 3
    Last Post: 04-26-2009, 05:10 AM
  5. Replies: 2
    Last Post: 10-19-2006, 04:37 PM

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