• CSV Tips: How to merge several CSV files together (Windows)

    There may be some situations, in which you have several CSV files and you want them merged together.

    For example, if one of your files looks like this:
    toyoya,camry,white
    ford,focus,blue
    honda,accord,red

    and the 2nd file contains:
    ford,focus,white
    honda,civic,red

    and a 3rd file has:
    Nissan,Altima,silver
    ford,escort,white

    of course, actual files might contain hundreds and hundreds or even thousands of lines. But say you have the files above, named file1.csv,file2.csv,file3.csv respetively, and you want to merge them all into a file4.csv which would look like this:

    toyoya,camry,white
    ford,focus,blue
    honda,accord,red
    ford,focus,white
    honda,civic,red
    Nissan,Altima,silver
    ford,escort,white

    This is easily done in windows. First, put them all under a single directory. Say, C:\temp

    Bring up the START menu (Bottom left Corner) and click Run... and type in CMD to bring the command prompt






    Go to the directory where you have the files saved:

    cd c:\temp

    Now type in this:
    copy *.csv file4.csv



    This will merge all the files with extension csv into a file named file4.csv

    Note that the original files will remain untouched.

    As always, feel free to comment if you have any issues, comments, or questions.
  • Sponsored Links

  • Advertisements