Thread
:
How can I combine multiple csv files with different number of records?
View Single Post
#
2
Posted to microsoft.public.excel.misc
smw226 via OfficeKB.com
external usenet poster
Posts: 98
How can I combine multiple csv files with different number of records?
Hi,
When I need to combine many csv files i use binary copy.
open a new command promt. then its :-
copy \b "full path to the folder containing"/*.csv "full path where you want
the file saved to"/joined.csv
this will join all the files into 1.
then, presuming you have less rows than Excel can handle! pivot (if all the
values are numeric) or I would put the data into Access and cross-tab it if
you have text in there too.
HTH
Simon
wrote:
I have a number of csv files that I would like to combine into one
spreadsheets. The problem is that not all the data is consistent. Here
is an example of what they look like:
File1:
Country Population
Armenia 100
Bangladesh 220
Cuba 103
Denmark 98
File2:
Country GDP
Armenia 12
Bangladesh 33
Denmark 48
etc, etc for about 300 countries
As you will notice, File 2 has no data for Cuba. I want to combine all
the data into one spreadsheet. If all countries were represented in
every file I would simply copy and paste the entire column, but that
wont work as the columns are never the same length.
by combining file 1 and 2 I would like to get the following
Country Population GDP
Armenia 100 12
Bangladesh 220 33
Cuba 103
Denmark 98 48
Any ideas on a quick clever way to do this?
--
--------------------
Simon - UK
Email at simon22mports [ a t ] hot mail [ d ot ]com
Message posted via
http://www.officekb.com
Reply With Quote
smw226 via OfficeKB.com
View Public Profile
Find all posts by smw226 via OfficeKB.com