Results 1 to 15 of 15
  1. #1
    Join Date
    Sep 2008
    Posts
    9

    Unanswered: HI ALL, How do I import text file into a single row?

    Hi all, firstly thanks for taking time to read my post and I hope that someone can help me with my question.

    Currently , I am trying to import data from text files.
    I do know the steps to do the importing.
    However , the problem is that I want to import the data in to ONE SINGLE ROW and not multiple rows

    I have upload the textfile that I need to import and also the output of what I want it to be.

    Hope that my question is understandable. THANKYOU AGAIN.
    Attached Files Attached Files
    Last edited by staze89; 09-25-08 at 22:16.

  2. #2
    Join Date
    Dec 2004
    Location
    Madison, WI
    Posts
    3,926
    You'd probably have to set up an import spec to do this but why would you want to do this? This isn't normally done. What causes problems if you import it as is?
    Expert Database Programming
    MSAccess since 1.0, SQL Server since 6.5, Visual Basic (5.0, 6.0)

  3. #3
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    It would be good to get some idea of the structure of the text file and a sample of what output you want.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  4. #4
    Join Date
    Sep 2008
    Posts
    9

    Reply:Pkstormy

    Pkstormy ,
    Thanks for the reply. Answering back to your question at why i am doing this; as i'm doing a project for school and it's requested by my supervisor to have the textfiles import into one single row.. (:
    Thus i am figuring out what I can do to get what I need to do.

    staze89
    Attached Files Attached Files

  5. #5
    Join Date
    Sep 2008
    Posts
    9

    Reply:StarTrekker

    StarTrekker,
    Thanks for the reply and the suggestions of uploading the
    structure of the text file and a sample of what output I want.
    It would let the others to understand what my questions is about
    (:

    staze89
    Attached Files Attached Files

  6. #6
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    No problem... so are you going to do that? I still can't see any sample output.

    But just BTW, a 411KB text file with a format like that surely can't go into one row. I think you're on an errand for a can of striped paint or a box of angle grinding sparks tbh.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  7. #7
    Join Date
    Sep 2008
    Posts
    9

    Reply:StarTrekker

    hi StarTrekker,
    you can't see the output sample?
    As i had zip and upload it in my POST. Couldn't it be open up?

    Haha, yes it seems hard but i am still reading up on books ON MICROSOFT ACCESS. There's nothing impossible when trying hard(:

    It be a great help, if you are able to figure out it.

    THANKS AGAIN

    staze89

  8. #8
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Oh... I see it now. I didn't notice you had modified post #1.

    Files.zip is a very good name... NOT!! I'll have to look at this later since it's an Access 2007 file. Ickk!
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  9. #9
    Join Date
    Sep 2008
    Posts
    9

    Reply:StarTrekker

    StarTrekker

    Well, it seems that it isn't the best named file afterall. haha
    Thanks for taking the time to look at the Access2007 when you have a freeslot to do so. I appreciate it .THANKS AGAIN

    staze89

  10. #10
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Ok, so your "sample output" looks EXACTLY THE SAME as the input data format

    In any case, if you want to import this data into one row, you're going to have to process it in a binary stream and ignore the characters that give carriage returns / line feeds.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  11. #11
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    Mind you, even if you import this into a Memo field, it still will hit limits. A memo field can hold 64,000 characters and your file is 411,000+ bytes.

    I seriously doubt you have understood the mission correctly.
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  12. #12
    Join Date
    Sep 2008
    Posts
    9

    Reply : StarTrekker

    Thanks again for the advices you gave. Indeed, i misunderstood and went to clarify it.

    The text file that i am suppose to import shouldn't be everything but part of it. . . and i had reupload the text files again.

    However i don't undestand what you meant by

    "you're going to have to process it in a binary stream and ignore the characters that give carriage returns / line feeds."
    What's binary stream?

    Anyway, thanks for your help and also the time to reply back.


    staze89

  13. #13
    Join Date
    Oct 2004
    Location
    Melbourne, Australia
    Posts
    201
    I think a salient point here is what you intend to do with the data once it has been imported. If you only wish to catalogue the file and display its contents, surely the simplest thing to do would be to store a link to the file in the database and then open up the file with the appropriate program.
    I did a project for an academic research organisation once where we catalogued all sorts of items, one of which was "documents". The table had a numeric key, a field for the title of the document, another for the type of document and finally the pathname to the document. Clicking on the combo box which displayed the file name ran a VBA function which created a DoCmd string which opened the requisite file. We had library functions in VBA which would run from a menu in the Word file (or whatever) and search for keywords and so forth.

  14. #14
    Join Date
    Nov 2007
    Location
    Adelaide, South Australia
    Posts
    4,049
    What I meant by processing it as a binary stream is to process the file character by character using an open statement such as Open Filename For Binary as #1
    Owner and Manager of
    CypherBYTE, Microsoft Access Development Specialists.
    Microsoft Access MCP.
    And all around nice guy!


    "Heck it's something understood by accountants ... so it can't be 'that' difficult..." -- Healdem
    "...teach a man to code and he'll be frustrated for life! " -- georgev

  15. #15
    Join Date
    Sep 2008
    Posts
    9

    Reply : StarTrekker

    Thanks for the advices. i am still trying out .
    Even though not sure if i get what i want in the end, thanks for all the help you had given. Especially for a newbie like me, I appreciated it .

    staze89

Posting Permissions

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