Results 1 to 7 of 7
  1. #1
    extent is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    4

    Question how to export database as txt file, in the alphabetical order of a chosen column?

    Hi, I am using ms office access 2007 to create a simple database, and I am wondering how I can export my database as a very simple txt file in the alphabetical order of a chosen column? I know I can do it if I right click on the database name, then choose 'export', 'text file', and tick to "export data with formatting and layout" , eg as an example :-



    ---------------------------------------------------
    | Book Title..................| Year |
    ---------------------------------------------------
    | Hearts In Atlantis........| 1992 |
    | Jurassic Park..............| 1995 |
    | The Planetary Guide.....| 1982 |
    ---------------------------------------------------

    ..but I would rather have a txt file export without the 'table' look. Is this impossible to do?
    If I export without ticking the "export data with formatting and layout" box, it gives me a txt file the way I want it to look, eg :-

    "The Planetary Guide",1982
    "Hearts In Atlantis",1992
    "Jurassic Park",1995

    ..but the titles, as you can now see, display in the order I originally entered them into the data table instead- and so are no longer alphabetical according to title name. Im assuming that access remembered the order of entry and gave ID numbers to each item when I first added them, which is why they display in this way? Is there a way to change these IDs in accordance to my 'titles' column, so that a very basic txt (without ticking the "export data with formatting and layout" box on exporting) will give me the names alphabetically instead? ..or is there an easier way to go about it? I did save my table whilst the title column showed alphabetically, but it still saves to txt according to order of entry, as above. I havent been using access for long, so may have missed something. thanks for any help!

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    Try creating a query that orders the records as you want, and export that.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    extent is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    4
    that did it! i created a query which essentially made a copied
    version I could edit and save in the correct order- thanks.
    I am wondering if its possible to make one last edit for my basic txt file output!

    eg :-

    "The Planetary Guide",1982
    "Hearts In Atlantis",1992
    "Jurassic Park",1995

    to look more like this in a txt file :-

    The Planetary Guide......1982
    Hearts In Atlantis..........1992
    Jurassic Park................1995

    ie without quotes, and with the same amount of space between each column?
    I had to use ..... instead of spaces, as this forum wont show the above
    correctly otherwise. thanks for any more help on where to click, if possible.

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I don't do much exporting to text files, but would a fixed-width export instead of delimited work for you?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    extent is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    4
    that might do the job what would you say was the best format to save to for a fixed width, without the 'table' look in my first post? thanks for the help

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,518
    I'm not sure what look you're after. Fixed width with spaces should look like this:
    Code:
    The Planetary Guide      1982
    Hearts In Atlantis       1992
    Jurassic Park            1995
    Though I could envision some variation depending on the font. Some fonts are variable width, so two fields with 20 characters might not line up exactly the same.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    extent is offline Novice
    Windows XP Access 2007
    Join Date
    May 2010
    Posts
    4
    a font with equal character width would be ideal I would want equal character width/spacing with no symbols (quotes, commas) or table formatting that outputting to a txt from access usually gives, but I dont know how to do it. being able to output to a txt file from access that would give me a database exactly as in your example is what im after... if thats not possible, any other output format is ok if there are easy ways to convert it to a txt without changes-although I wouldnt know how to go about converting formats. aside from that, it would seem saving to a txt file to show something similar to your example may be impossible?

    thanks
    Last edited by extent; 05-12-2010 at 09:33 AM.

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

Similar Threads

  1. File Export
    By Kencao in forum Import/Export Data
    Replies: 3
    Last Post: 02-01-2010, 05:27 PM
  2. omit word in entry for alphabetical order
    By airhud86 in forum Access
    Replies: 1
    Last Post: 12-14-2009, 03:49 PM
  3. Possible to export *.mdb file to *.exe file?
    By slpuiwan in forum Import/Export Data
    Replies: 1
    Last Post: 12-16-2007, 06:52 PM
  4. inport data into invoice from Purchase order database
    By Wrangler in forum Import/Export Data
    Replies: 2
    Last Post: 10-30-2006, 12:28 PM
  5. How do you export a file with a unique file name
    By Budman42 in forum Import/Export Data
    Replies: 1
    Last Post: 10-15-2006, 06:10 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