Mohsen Jafarikia
2016-Jan-13 14:47 UTC
[R] Multiple CSV files in different sheets of an Excel file
Thanks Frans, My files are CSV. If presume first I should convert them to Excel format and run the code you have suggested. Am I right? Thanks again, Mohsen On Wed, Jan 13, 2016 at 9:44 AM, Frans Marcelissen < fransiepansiekevertje at gmail.com> wrote:> Hi Mohse, > You can do that with the append parameter of the write.xlsx routine in the > xlsx package: > > xlsx::write.xlsx(file1,file='XXXXX.xlsx',sheetName = '1') > xlsx::write.xlsx(file2,file='XXXXX.xlsx',sheetName = '2',append = T) > > Success! > Frans > > 2016-01-13 15:18 GMT+01:00 Mohsen Jafarikia <jafarikia at gmail.com>: > >> I have multiple CSV files that I would like to have them in a single Excel >> file. For example, I have file1.csv and file2.csv and I want to have >> file.xls where file1.csv and file2.csv each have been copied to a single >> sheet of the file.xls file. >> >> Thanks, >> Mohsen >> >> [[alternative HTML version deleted]] >> >> ______________________________________________ >> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >> stat.ethz.ch/mailman/listinfo/r-help >> PLEASE do read the posting guide >> R-project.org/posting-guide.html >> and provide commented, minimal, self-contained, reproducible code. >> > >[[alternative HTML version deleted]]
Frans Marcelissen
2016-Jan-13 14:53 UTC
[R] Multiple CSV files in different sheets of an Excel file
Hi Mohsen, Just read them with read.csv or read.table (file1<-read.csv(file=.....), and you can write them. Success! Frams 2016-01-13 15:47 GMT+01:00 Mohsen Jafarikia <jafarikia at gmail.com>:> Thanks Frans, > > My files are CSV. If presume first I should convert them to Excel format > and run the code you have suggested. Am I right? > > Thanks again, > Mohsen > > > On Wed, Jan 13, 2016 at 9:44 AM, Frans Marcelissen < > fransiepansiekevertje at gmail.com> wrote: > >> Hi Mohse, >> You can do that with the append parameter of the write.xlsx routine in >> the xlsx package: >> >> xlsx::write.xlsx(file1,file='XXXXX.xlsx',sheetName = '1') >> xlsx::write.xlsx(file2,file='XXXXX.xlsx',sheetName = '2',append = T) >> >> Success! >> Frans >> >> 2016-01-13 15:18 GMT+01:00 Mohsen Jafarikia <jafarikia at gmail.com>: >> >>> I have multiple CSV files that I would like to have them in a single >>> Excel >>> file. For example, I have file1.csv and file2.csv and I want to have >>> file.xls where file1.csv and file2.csv each have been copied to a single >>> sheet of the file.xls file. >>> >>> Thanks, >>> Mohsen >>> >>> [[alternative HTML version deleted]] >>> >>> ______________________________________________ >>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>> stat.ethz.ch/mailman/listinfo/r-help >>> PLEASE do read the posting guide >>> R-project.org/posting-guide.html >>> and provide commented, minimal, self-contained, reproducible code. >>> >> >> >[[alternative HTML version deleted]]
Mohsen Jafarikia
2016-Jan-13 16:30 UTC
[R] Multiple CSV files in different sheets of an Excel file
Hi Frans, There is a problem that my csv files are not just several columns of data. I have some data and then a couple of tables after my data. I can't use read.table to read my files. There should be something different to look at the whole csv sheet. Thanks again, Mohsen On Wed, Jan 13, 2016 at 9:53 AM, Frans Marcelissen < fransiepansiekevertje at gmail.com> wrote:> Hi Mohsen, > Just read them with read.csv or read.table (file1<-read.csv(file=.....), > and you can write them. > Success! > Frams > > 2016-01-13 15:47 GMT+01:00 Mohsen Jafarikia <jafarikia at gmail.com>: > >> Thanks Frans, >> >> My files are CSV. If presume first I should convert them to Excel format >> and run the code you have suggested. Am I right? >> >> Thanks again, >> Mohsen >> >> >> On Wed, Jan 13, 2016 at 9:44 AM, Frans Marcelissen < >> fransiepansiekevertje at gmail.com> wrote: >> >>> Hi Mohse, >>> You can do that with the append parameter of the write.xlsx routine in >>> the xlsx package: >>> >>> xlsx::write.xlsx(file1,file='XXXXX.xlsx',sheetName = '1') >>> xlsx::write.xlsx(file2,file='XXXXX.xlsx',sheetName = '2',append = T) >>> >>> Success! >>> Frans >>> >>> 2016-01-13 15:18 GMT+01:00 Mohsen Jafarikia <jafarikia at gmail.com>: >>> >>>> I have multiple CSV files that I would like to have them in a single >>>> Excel >>>> file. For example, I have file1.csv and file2.csv and I want to have >>>> file.xls where file1.csv and file2.csv each have been copied to a single >>>> sheet of the file.xls file. >>>> >>>> Thanks, >>>> Mohsen >>>> >>>> [[alternative HTML version deleted]] >>>> >>>> ______________________________________________ >>>> R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see >>>> stat.ethz.ch/mailman/listinfo/r-help >>>> PLEASE do read the posting guide >>>> R-project.org/posting-guide.html >>>> and provide commented, minimal, self-contained, reproducible code. >>>> >>> >>> >> >[[alternative HTML version deleted]]