+ Reply to Thread
Results 1 to 4 of 4

Excel 2007 : How can I sort A-Z of 4 csv files with more than 1000000 rows in each csv

  1. #1
    Registered User
    Join Date
    02-27-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2007
    Posts
    13

    How can I sort A-Z of 4 csv files with more than 1000000 rows in each csv

    Hi,

    I have 4 csv files with 1000000 rows in all of them.

    I need to somehow sort all these at one place and by A-Z

    Is this possible?

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: How can I sort A-Z of 4 csv files with more than 1000000 rows in each csv

    If you can't consolidate the four files into one CSV file and sort them, then you could import each into Access (assuming that the structure of each is the same) into one table. Run a sort and then either run a report or export the query (sort) to a text, pdf or csv file.

    Alan
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Registered User
    Join Date
    02-27-2011
    Location
    Kolkata, India
    MS-Off Ver
    Excel 2007
    Posts
    13

    Re: How can I sort A-Z of 4 csv files with more than 1000000 rows in each csv

    Thanks for the info. Yes the file structure is same.

    Can you please guide me step by step on what I need to do in ms access as I am not used to it.

    Also can i separate the files back from access in 4 csv file after sorting?

    Quote Originally Posted by alansidman View Post
    If you can't consolidate the four files into one CSV file and sort them, then you could import each into Access (assuming that the structure of each is the same) into one table. Run a sort and then either run a report or export the query (sort) to a text, pdf or csv file.

    Alan

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,873

    Re: How can I sort A-Z of 4 csv files with more than 1000000 rows in each csv

    Using Access 2007, open Access and create a new database. On the ribbon, click on External Data. Select Text File. For the first file, follow the wizard. For the subsequent files, follow the wizard but in the second check box, indicate that you want to append each of the imports to the table you created in the first import. If it prompts you for a primary key, suggest you indicate no, as you will not need it for this exercise.

    Once you have the four files imported, clickon create on the ribbon. Select Query. Select the table you created. Drag each of the fields from the table down to the grid. In the grid on the sort line for the field you want to sort, select from the drop down Ascending. In the upper left hand side, you will see a box that looks like a spreadsheet. Click on it to show your results.

    Now you will need to make this new report into a new table. Going back to the box in the upper left corner, click on the triangle to change it back to the design mode. Now select the make table icon and follow the wizard. If it ask if you want to have a primary key, indicate yes. If it doesn't. Don't worry.

    Once the new table has been created, if there was no primary key added, then you should open the newly created table in design view. Insert a new row and name it PKID. Click on the icon to make it a primary key and close the table.

    On the ribbon select create and create a new query. Select the new table and add the fields including the new PKID field to the grid. In the criteria line of the field for PKID, type Between 0 and 1000000. Now click on the spreadheet Icon. With the query open, click on the External Data on the ribbon and select export and then select text file. Follow the wizard. Once this has been completed, click on home on the ribbon and then the triangle, change the criteria to whatever number of records you want to export, next 1M, perhaps. Repeat this until all records are exported.

    Good luck with this. It may sound confusing, but it really is a very easy means to achieve your goal. Take it slow and easy and you will have success.

    Alan

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1