+ Reply to Thread
Results 1 to 6 of 6

How to split large excel sheet into two separate text file (.txt)?

  1. #1
    Registered User
    Join Date
    09-27-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    97

    How to split large excel sheet into two separate text file (.txt)?

    Hi guys,

    I have an excel file with first sheet having large quantity of data, say around 200,000 rows of data. I'm able to save the sheet data to a text file, but due to the amount of data i'm unable to upload this text file into server. Is there any VBA macro to split this sheet data into two text files with headers intact in both files? For example, first sheets with total of 200,000 records split up with 100,000 records in one text file and another 100,000 in another text file, headers will be same in both. Note: headers and rows may change overtime.

    Any help with this will be great.

    The same has been posted here:
    https://www.mrexcel.com/forum/excel-...-file-txt.html

    Thanks
    Jackal
    Last edited by JayeshG; 02-26-2019 at 06:21 PM.

  2. #2
    Forum Guru MarvinP's Avatar
    Join Date
    07-23-2010
    Location
    Woodinville, WA
    MS-Off Ver
    Office 365
    Posts
    16,169

    Re: How to split large excel sheet into two separate text file (.txt)?

    Hi JayeshG,

    Have you considered Zipping the text file before trying to upload it to a server?

    If you need to do it in Excel, you could open a new workbook and do a Power Query that would pull in the first 100,000 rows from the file. You would then save this first workbook and open another new file and pull in the second 100,000 rows. I imagine you would want to use an "Index" column in Power Query and filter based on the row number. The newer versions of Excel can use Power Query. You will need to download it as an Add-in for 2010 version.

    Hope this helps.
    Last edited by MarvinP; 02-26-2019 at 02:11 PM.
    One test is worth a thousand opinions.
    Click the * Add Reputation below to say thanks.

  3. #3
    Registered User
    Join Date
    09-27-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    97

    Re: How to split large excel sheet into two separate text file (.txt)?

    Thanks, MarvinP,

    Actually, i run a set of vba macros to run different files and upload it to a program, so zipping is out of scope. I upload the content to the program, sort of a daily update routine. I cannot run Power Query at this stage, i just need a simple vba macro which can run with other set of macros i have. Thank you.

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

    Re: How to split large excel sheet into two separate text file (.txt)?

    Rule 03: Cross-posting Without Telling Us

    Your post does not comply with Rule 3 of our Forum RULES. Do not cross-post your question on multiple forums without telling us about your threads on other forums.

    Post a link to any other forums where you have asked the same question.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).


    No further help to be offered, please, until the OP has complied with this request.
    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

  5. #5
    Registered User
    Join Date
    09-27-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    97

    Re: How to split large excel sheet into two separate text file (.txt)?

    Reposted...Thank you!

  6. #6
    Registered User
    Join Date
    09-27-2014
    Location
    India
    MS-Off Ver
    2010
    Posts
    97

    Re: How to split large excel sheet into two separate text file (.txt)?

    Hi guys,

    I've found a code which does what i need, but it doesn't save it in a text file as required. It saves as .txtm file. Any help tweaking the SaveAs statement will be of great help. Thanks! Here is the code.

    Please Login or Register  to view this content.
    Same has been posted here:
    https://www.mrexcel.com/forum/excel-...-file-txt.html
    Last edited by JayeshG; 02-27-2019 at 06:21 PM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Split Large Excel file to multiple excel files
    By kambeng02 in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 02-24-2021, 01:11 AM
  2. [SOLVED] Split Large Excel XLSX File Into Multiple XLS Files
    By EnormousRA in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 08-23-2016, 08:56 PM
  3. Importing big text file into separate excel sheet
    By Sridharmak in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-17-2014, 06:00 AM
  4. Split Large Excel XLSX File Into Multiple XLS Files
    By EnormousRA in forum Excel General
    Replies: 1
    Last Post: 10-05-2013, 09:18 AM
  5. [SOLVED] separate large file into separate worksheets (by state)
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 02-01-2013, 01:41 PM
  6. How to split excel file into separate workbooks based on number of columns?
    By nandana83 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-31-2012, 04:03 AM
  7. [SOLVED] How To Split Excel File Into Separate Workbooks Based on Values In a Specific Column
    By UzieJacuzzi in forum Excel Programming / VBA / Macros
    Replies: 30
    Last Post: 07-31-2012, 07:26 AM
  8. Separate large excel sheet into groups of 250.
    By marketmyauto in forum Excel General
    Replies: 6
    Last Post: 01-15-2008, 01:56 PM

Tags for this Thread

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