[R] read_excel() ignore case of worksheet name?
Ravi Jeyaraman
r@v|76 @end|ng |rom gm@||@com
Wed May 27 13:10:33 CEST 2020
Ista, With few tweaks this worked beautifully. Thank you so much.
-----Original Message-----
From: Ista Zahn [mailto:istazahn using gmail.com]
Sent: Tuesday, May 26, 2020 11:38 PM
To: Ravi Jeyaraman <ravi76 using gmail.com>
Cc: Erin Hodgess <erinm.hodgess using gmail.com>; r-help using r-project.org
Subject: Re: [R] read_excel() ignore case of worksheet name?
How about
read_excel_table <- function(x) {
readxl::read_excel(
x,
sheet=grep("tables",
excel_sheets(x),
ignore.case = TRUE,
value = TRUE),
.name_repair = fixColNames
)
}
lapply(SIS$FULL_FILEPATH, read_excel_table)
--Ista
On Tue, May 26, 2020 at 11:05 PM Ravi Jeyaraman <ravi76 using gmail.com> wrote:
>
> I’ve already tried that and doesn’t work
>
>
>
> From: Erin Hodgess [mailto:erinm.hodgess using gmail.com]
> Sent: Tuesday, May 26, 2020 10:55 PM
> To: Ravi Jeyaraman <ravi76 using gmail.com>
> Cc: r-help using r-project.org
> Subject: Re: [R] read_excel() ignore case of worksheet name?
>
>
>
> Here’s a thought, please. Could you use the tolower function and make them all lower case?
>
>
>
> Thanks,
>
> Erin
>
>
>
> On Tue, May 26, 2020 at 8:21 PM Ravi Jeyaraman <ravi76 using gmail.com <mailto:ravi76 using gmail.com> > wrote:
>
> Hello All, Is there any parameter to make read_excel() ignore the case-sensitiveness of the worksheet? I'm using the below to ready in multiple spreadsheets and it works perfectly fine if the worksheet is named 'Tables', but fails when it's named ' TABLES'. Any thoughts?
>
> lapply(1:nrow(SIS), function(x)
> readxl::read_excel(SIS$FULL_FILEPATH[x], sheet='Tables', .name_repair
> = fixColNames))
>
> Thanks in advance for your response.
>
> Cheers
> Ravi
>
>
>
> --
> This email has been checked for viruses by AVG.
> https://www.avg.com
>
> ______________________________________________
> R-help using r-project.org <mailto:R-help using r-project.org> mailing list -- To
> UNSUBSCRIBE and more, see https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
> --
>
> Erin Hodgess, PhD
>
> mailto: erinm.hodgess using gmail.com <mailto:erinm.hodgess using gmail.com>
>
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
--
This email has been checked for viruses by AVG.
https://www.avg.com
More information about the R-help
mailing list