+ Reply to Thread
Results 1 to 8 of 8

Splitting a single column from a file (csv), into several individual files (txt), evenly.

  1. #1
    Registered User
    Join Date
    01-02-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2003
    Posts
    63

    Splitting a single column from a file (csv), into several individual files (txt), evenly.

    Hi guys,

    I need help for making a code to split my master .csv file into multiple .txt files.

    MY DATA

    - My data is just the one column, from A1 to A1000

    MY REQUIREMENT

    1. I need to split a csv file, containin 1000 names, into 10 separate (equal sized) txt files.

    2. I'd like those files to be named as follows:
    Input_1_100.txt
    Input_101_200.txt
    Input_201_300.txt

    (etc, etc)

    It will be really helpful if someone can help me in this problem, i will be glad to provide sample data or further explanation if necessary.


    Thank you greatly, in advance

    -------------------------------


    update Mon 03/03 6.10pm

    Ive actually managed to convert the column into several rows, each row representing a txt file

    Ive attached the new masterfile (contains macro and is macro enabled), as well as the resulting 10 files (4 of which ive attached)

    The problem is that the names in each file appear in the one row, and not in a neat column (without spaces in between each line)

    So it looks like this:

    James.AJohn.ARobert.AMichael.AWilliam.ADavid.ARichard.AJoseph.ACharles.AThomas.AChristopher.A

    Instead of this:

    James.A
    John.A
    Robert.A
    Michael.A
    William.A
    David.A
    Richard.A
    Joseph.A
    Charles.A
    Thomas.A
    Christopher.A


    Please Login or Register  to view this content.

    I'd appreciate any help on this
    Attached Files Attached Files
    Last edited by Rob8489; 03-03-2014 at 03:19 AM.

  2. #2
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Splitting a single column from a file (csv), into several individual files (txt), even

    put this code in masterfile.csv, save as xlsm then run it
    Please Login or Register  to view this content.
    If solved remember to mark Thread as solved

  3. #3
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,652

    Re: Splitting a single column from a file (csv), into several individual files (txt), even

    Here's another method.

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 03-03-2014 at 04:06 AM.
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  4. #4
    Registered User
    Join Date
    01-02-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Splitting a single column from a file (csv), into several individual files (txt), even

    AlphaFrog & Patel45, thank you, thank you, thank you !!

    amazing!

  5. #5
    Registered User
    Join Date
    01-02-2012
    Location
    Melbourne
    MS-Off Ver
    Excel 2003
    Posts
    63

    Re: Splitting a single column from a file (csv), into several individual files (txt), even

    duplicate post
    Last edited by Rob8489; 03-03-2014 at 04:05 AM. Reason: duplicate

  6. #6
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Splitting a single column from a file (csv), into several individual files (txt), even

    Hi..

    Add a CommandButton to your Master.csv file and save it as a xlsm file..

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by apo; 03-03-2014 at 06:35 AM.

  7. #7
    Forum Expert
    Join Date
    07-15-2012
    Location
    Leghorn, Italy
    MS-Off Ver
    Excel 2010
    Posts
    3,431

    Re: Splitting a single column from a file (csv), into several individual files (txt), even

    @apo
    very good and fast

  8. #8
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Splitting a single column from a file (csv), into several individual files (txt), even

    @patel45..

    Thanks mate

+ 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. Importing Multiple individual txt files into one single spreadsheet using 2003 Excel
    By keige123 in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-22-2013, 10:29 PM
  2. Splitting a file into multiple files as per a column
    By DCS2010 in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-01-2012, 10:29 AM
  3. Splitting file to several files
    By Hootie in forum Excel General
    Replies: 0
    Last Post: 10-27-2010, 01:31 PM
  4. Replies: 2
    Last Post: 04-03-2006, 05:50 AM
  5. Splitting single column data into two
    By loopkid1 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-31-2006, 01:30 PM

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