+ Reply to Thread
Results 1 to 4 of 4

Create multiple columns from text file list with over 57 million values.

  1. #1
    Registered User
    Join Date
    04-16-2009
    Location
    Carson City, Nevada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Create multiple columns from text file list with over 57 million values.

    I have a text file that contains 57,600,000 million lines of values. These values are in a single column in the text file. They represent a 150(column) x 160(row) matrix repeated 2400 times. I wish to complete 2 different operations, each with 3 objectives.

    Operation 1 (column)

    Open the text file
    Select every nth data point
    Save the selected values to another .csv or xlsx

    Operation 2 (row)

    Open the text file
    Select a range of values (150) starting every nth line
    Save the selected values to another .csv or xlsx

    If this cannot be done alternative 2 would be to break the list into 2400 columns by 24000 rows

    Thank you very much for looking and any assistance you can give.

    I would post the file but it is around 100 mb
    Attached Files Attached Files
    Last edited by Water Doc; 12-15-2012 at 05:15 PM. Reason: add file

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Create multiple columns from text file list with over 57 million values.

    Please try these two

    Please Login or Register  to view this content.
    Open up the VBA editor by hitting ALT F11

    Insert a new module by hitting Insert - Module

    Paste the macro into the empty sheet

    Hit ALT F11 to get back to the worksheet.

    Run the macro by going to tools-macro in Excel 2003 or the view ribbon in Excel 2007/2010.

  3. #3
    Registered User
    Join Date
    04-16-2009
    Location
    Carson City, Nevada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Create multiple columns from text file list with over 57 million values.

    Martin,
    Thank you very much for your assistance. I have tried to run the script but am not getting the correct number of values. I feel this is due to my lack of problem explanation or improperly modifying the code you supplied. To ensure I have explained it correctly I have attached a file above for your review and comment.
    Thank you

  4. #4
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Create multiple columns from text file list with over 57 million values.

    Can you try this. It compiles a 160 x 150 matrix in memory and then selectively reads rows and columns.

    Please Login or Register  to view this content.
    You will need to change at least one of the For rows as indicated.

  5. #5
    Registered User
    Join Date
    04-16-2009
    Location
    Carson City, Nevada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Create multiple columns from text file list with over 57 million values.

    Hi Martin,
    I ran the script and got 24,000 values, however when selecting the column data I should get 160*2400=384,000 and for row data I should get 150*2400=360,000 any thoughts?

    The other alternative is to create an array of 24,000 values in a column (vertically) by 2,400 values in a row (horizontally) then I could work with this file in Excel.

    So the first 24,000 values would become column 1, the next 24,000 values would become column 2, and so on repeated 2,400 times.

    Thanks Again!

  6. #6
    Registered User
    Join Date
    04-16-2009
    Location
    Carson City, Nevada
    MS-Off Ver
    Excel 2007
    Posts
    16

    Re: Create multiple columns from text file list with over 57 million values.

    Thanks Again!

+ 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