How do you combine multiple csv files into one file?

Discussion in 'Microsoft Excel Worksheet Functions' started by Brian Wenner, Jul 1, 2003.

  1. Brian Wenner

    Brian Wenner Guest

    Hello,

    I have six comma delimited files with a csv extensions on my desktop. I want
    to combine the six files into one file and load them into Excel. Right now I
    am loading all six into one session of excel then I copying the contents of
    one book and paste into the first book, copy paste, copy paste, copy paste,
    etc... I figure there has to be a better way. So my question is:

    How do you combine multiple csv files into one file with Excel?


    Brian


    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.493 / Virus Database: 292 - Release Date: 6/25/2003
     
    Brian Wenner, Jul 1, 2003
    #1
    1. Advertisements

  2. Brian Wenner

    Microsoft Guest

    As I recall, arent the CSV files just text with Comma Seperators? If that is
    the case open them in notepad and paste them together!
    MArcos

    "Brian Wenner" <> wrote in message
    news:yO5Ma.69992$R73.9734@sccrnsc04...
    > Hello,
    >
    > I have six comma delimited files with a csv extensions on my desktop. I

    want
    > to combine the six files into one file and load them into Excel. Right now

    I
    > am loading all six into one session of excel then I copying the contents

    of
    > one book and paste into the first book, copy paste, copy paste, copy

    paste,
    > etc... I figure there has to be a better way. So my question is:
    >
    > How do you combine multiple csv files into one file with Excel?
    >
    >
    > Brian
    >
    >
    > ---
    > Outgoing mail is certified Virus Free.
    > Checked by AVG anti-virus system (http://www.grisoft.com).
    > Version: 6.0.493 / Virus Database: 292 - Release Date: 6/25/2003
    >
    >
     
    Microsoft, Jul 1, 2003
    #2
    1. Advertisements

  3. Brian Wenner

    drwecki

    Joined:
    Jan 4, 2007
    Messages:
    2
    Likes Received:
    0
    Actually, that won't solve Brian's problem. There is a program that costs 20 bucks that will do it for you but...I don't think so.... All you need to do is open your DOS prompt i.e

    Start>Run>type "cmd"

    Then make sure all your csv files are in the same folder. I caled my folder help and put it in the C: folder.

    Type CD C:help (hit enter)

    You should see some verification that you are in this folder.

    Type copy *.csv name.csv

    Note there is a space between the word copy and the * and a space between.csv and name. Also note that you can change name to anything you want. This will copy all csv files an combine them in a file called name.csv. It copies them in such a manner that it is identical to copying and pasting multiple csvs in excell on the vertical axis 1 to infinity (Not a to vv). It's pretty sweet.


    Brian 2
     
    drwecki, Jan 4, 2007
    #3
  4. Brian Wenner

    drwecki

    Joined:
    Jan 4, 2007
    Messages:
    2
    Likes Received:
    0
    I meant to say type cd c:\help...that will do it
     
    drwecki, Jan 4, 2007
    #4
  5. Brian Wenner

    bkarim2

    Joined:
    May 17, 2007
    Messages:
    2
    Likes Received:
    0
    Thanks a lot

    Thanks a lot dude, you are the man!
     
    bkarim2, May 17, 2007
    #5
  6. Brian Wenner

    whatfourever

    Joined:
    May 22, 2007
    Messages:
    2
    Likes Received:
    0
    How about instead, you go to the command window. (Press "Window Key" and "R", then type command and enter.

    Type copy c:\*.csv c:\File.csv and press enter

    This will combine all of the csv files that are in your root c:\ directory into one file called File.csv.

    You can change the file names and paths as necessary.

    Paul
     
    whatfourever, May 22, 2007
    #6
  7. Brian Wenner

    whatfourever

    Joined:
    May 22, 2007
    Messages:
    2
    Likes Received:
    0
    Sorry guys. I see someone already gave that suggestion.


    later
     
    whatfourever, May 22, 2007
    #7
  8. Brian Wenner

    user123

    Joined:
    Aug 7, 2009
    Messages:
    1
    Likes Received:
    0
    i have a similiar problem and the command works as long as all the .csv files are in the same folder.
    i was wondering if there is a variation of this that tells it to look in subfolders for the .csv file?

    ie:
    C:\temp\folder1\file1.csv
    and
    C:\temp\folder2\file2.csv
    and
    C:\temp\folder3\file3.csv

    is there someway to combine it all into 1 csv file?
    (copy and pasting the .csv files into one folder can be hard when you have a lot of folders,

    thanks in advance!
     
    user123, Aug 7, 2009
    #8
  9. Brian Wenner

    rfi234

    Joined:
    Oct 23, 2008
    Messages:
    6
    Likes Received:
    0
    There is a neat program that will handle the merge of multiple csv files to one master file. Bulk File Merger will do the trick. We just banged through 240 files in a matter of seconds. The program also merges xls, doc, pdf and txt files...
     
    rfi234, Dec 3, 2009
    #9
  10. Brian Wenner

    nasureshkumar

    Joined:
    Dec 20, 2009
    Messages:
    1
    Likes Received:
    0
    Hi

    I tried to use the command mentioned by drwecki vbmenu_register("postmenu_9254273", true); to combile multiple CSV files to one csv.
    i facing following issue.

    1. Header are repeating while merging into one file.

    Please help to resolve the same.

    Thanks and regards
    Suresh
     
    nasureshkumar, Dec 20, 2009
    #10
  11. Brian Wenner

    trottida

    Joined:
    Apr 14, 2010
    Messages:
    1
    Likes Received:
    0
    Ok, this is great but is there a way to include the file name in each record in the first column?
     
    Last edited: Apr 14, 2010
    trottida, Apr 14, 2010
    #11
  12. Brian Wenner

    Ancient Jake

    Joined:
    Oct 9, 2010
    Messages:
    1
    Likes Received:
    0
    Thank you so much for this post drwecki - saved me a days work
     
    Ancient Jake, Oct 9, 2010
    #12
  13. Brian Wenner

    frantzie

    Joined:
    Jun 22, 2011
    Messages:
    1
    Likes Received:
    0
    I know this is an old thread, but anyway:
    Make 2 new columbs ind the merged sheet.
    Columb 1, an index columb,
    Columb 2, index for each merged csv

    1 1
    2 2
    3 1
    4 2
    5 1
    6 2
    7 1
    ...

    Then sort by columb 2, delet all headers
    then sort by columb 1,

    Your sheet is cleaned for headers...
     
    frantzie, Jun 22, 2011
    #13
  14. Brian Wenner

    gjobby

    Joined:
    Jul 24, 2011
    Messages:
    1
    Likes Received:
    0
    I have the same question as trottida, any solutions?
    Ok, this is great but is there a way to include the file name in each record in the first column?
    Thanks
     
    gjobby, Jul 24, 2011
    #14
  15. Brian Wenner

    rtos32

    Joined:
    Mar 21, 2012
    Messages:
    1
    Likes Received:
    0
    PHP doubt: I have 5 csv files. I have to read each scv files and required column values to be taken and store it as new csv column wise . Example first csv file 0,1,3,4,6 column values to be take and store it new.csv first 5 columns and than to read second csv file to take col 3,4,8 values to be store to new.csv file 6,7,8th column. The to read 3rd csv file to take col 3,4,5,9 to be stored in new csv 9,10,11,12th columns.. Can anyone help me great in PHP programming fedora12. Thanks in advance K.Prabu
     
    rtos32, Mar 21, 2012
    #15
  16. Brian Wenner

    denzees

    Joined:
    Jul 7, 2012
    Messages:
    1
    Likes Received:
    0
    Excellent work brother.
    many many thanks for saving my lots of time.
     
    denzees, Jul 7, 2012
    #16
  17. Brian Wenner

    MK24

    Joined:
    Aug 20, 2014
    Messages:
    1
    Likes Received:
    0
    Hi, drwecki your advice worked for me, thank you so much!

    But question: After I followed your guidelines in command prompt and it finished running, the new csv file with all of the combined csv's won't open in excel. I had to combine 564 csv files with over 200,000 entries in each. When I open the new file with all of them combined, the excel sheet is blank (no cells or anything, just a dark grey color).

    Are these too many files to be combining or do you think there was another issue?
     
    MK24, Aug 20, 2014
    #17
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Lance

    multiple columns of data to combine into one column

    Lance, Aug 22, 2003, in forum: Microsoft Excel Worksheet Functions
    Replies:
    0
    Views:
    335
    Lance
    Aug 22, 2003
  2. Michael Tomasura

    Combine multiple cells into one cell

    Michael Tomasura, Aug 23, 2003, in forum: Microsoft Excel Worksheet Functions
    Replies:
    2
    Views:
    316
  3. RW

    combine information from multiple file into many different files.

    RW, Jun 8, 2008, in forum: Microsoft Excel Worksheet Functions
    Replies:
    2
    Views:
    452
  4. Nedulous

    how do I merge multiple csv files in one Excel file?

    Nedulous, Apr 28, 2009, in forum: Microsoft Excel Worksheet Functions
    Replies:
    6
    Views:
    1,801
    Ron de Bruin
    May 17, 2009
  5. Janet Kreinbrink

    How do you combine a date field and a time field into one?

    Janet Kreinbrink, Nov 9, 2009, in forum: Microsoft Excel Worksheet Functions
    Replies:
    6
    Views:
    489
    Janet Kreinbrink
    Nov 10, 2009
Loading...

Share This Page