Results 1 to 2 of 2
  1. #1
    pensived is offline Novice
    Windows 7 32bit Access 2007
    Join Date
    Feb 2012
    Posts
    1

    I know it's easy but it's driving me crazy!!!

    I have a strange text file that contains values separated by a 2 character abbreviation. ie. "PN" and "QT" I can import just fine, but I can't seem to get the data to separate into separate columns.


    This is what the text file looks like.
    PN=DSAI6612


    QT=3
    PN=CT22L
    QT=3


    after I import and filter through a query it looks like


    Field1 Field2
    PN DSAI6612
    QT 3
    PN CT22L
    QT 3


    Problem is, I need it to look like this


    Field1 Field2
    DSAI6612 3
    CT22L 3




    I don't know what I'm missing.
    Please help!!


    Thank you in advance

  2. #2
    June7's Avatar
    June7 is online now VIP
    Windows XP Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,822
    You are using the import wizard? It is working properly. Each line of the text file is a record and the values are separated by = sign. Unfortunately the records are pairs. Aside from the sequence in the text file, there is no way to know which PN goes with which QT. The wizard can't handle this for you. This will require VBA code to 'rearrange' the data during the import operation. Here is an example of code http://www.freevbcode.com/ShowCode.asp?ID=612
    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Crazy Counting
    By gbharris in forum Queries
    Replies: 1
    Last Post: 08-31-2011, 03:07 PM
  2. Replies: 0
    Last Post: 03-29-2011, 09:37 AM
  3. ShipToCode is driving me crazy
    By Accessgrasshopper in forum Access
    Replies: 7
    Last Post: 02-26-2011, 04:55 PM
  4. Report issue driving me crazy
    By Grofica in forum Reports
    Replies: 11
    Last Post: 01-28-2011, 11:23 AM
  5. Autonumber gone crazy
    By asearle in forum Access
    Replies: 1
    Last Post: 07-27-2010, 05:41 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