Open mattpatton4 opened 4 years ago
output file = ResultsSummary_v1.xlsx
Copy of BTA+Battery v13_Borah3.zip ResultsSummary_v1.xlsx "Z:\RFPs\RFP 2020AS\Bid Evaluations\Initial Screening"
Here is the pshell code, slightly modified and resulting txt file. models.txt
Get-ChildItem -Path "Z:\RFPs\RFP 2020AS\Bid Evaluations\Initial Screening" -Recurse -Include .xlsb -name >>models.txt
rm(list=ls()) unlink(".RData") library(xlsx) library(RODBC) library(RCurl) library(XLConnect)
Folder <- "N:\RFPs\RFP 2017 Wyoming Wind\Bid Evaluations\Final Shortlist 21% Fed Tax\" Directories <- list.dirs(path = Folder, full.names = TRUE, recursive = FALSE) Output <- paste("N:\RFPs\RFP 2017 Wyoming Wind\Bid Evaluations\Final Shortlist 21% Fed Tax\TaxAdjWindBidsSummary",format(Sys.Date(),"%Y%m%d"),".xlsx",sep='') colname <- "Description"
for (i in 1:1:length(Directories)) { LFs <- list.files(Directories[i], pattern="WY|UT|WA&.xlsm") #pattern would be ignored LF <- LFs[grep(".xlsm",LFs)] #now just ".xlsb"
} Combined <- sapply(Combined, as.character) Combined[is.na(Combined)] <- " " colnames(Combined) <- colname write.xlsx(Combined,Output,sheetName="Summary",row.names=FALSE,col.names=TRUE) close(db)