[R] Reading multiple files from different folders

Val valkremk at gmail.com
Thu Aug 13 04:37:20 CEST 2015


Hi all,

I have several files in different folders or subdirectories.  Here is an
example of the data set.

c:\country\state\city.  There might be more than 500 cities.

**********************************
c:\country\state\city1
c:\country\state\city2
.
.
.
c:\country\state\city500

***************************
Cities may keep  the population record either in Excel file or  text file
 format ( *.xlsx or *.txt)

Each file contains :   first name, last name, address, zip code, etc

I want  to create one data set  from  all the cities  for analysis of in
interest.

Output should looks  like

country,  state, city, first name, last name, address, zip code,  etc.
 USA ,    NY ,  city1, Alex    ,    John  ,     102  st name ,   10004 ,
 USA   ,     NY ,     city1    Martin  ,         Leno  ,       284 street
name  ,  10003 ,
 .
 .
 USA,    NY ,  city500,  Ethan , Noah  ,   543  st name ,  10015 ,

Please note that variables  Country, state and city come from the
 " c:\country\state\city"

I would appreciate your  help me in reading and combing this data sets

Thank you in advance,

	[[alternative HTML version deleted]]



More information about the R-help mailing list