library(readxl) Input <- read_excel("/Users/gregg/Downloads/TRACKING_LIST-2021-11-16T20_41_38.501557.xlsx") MacGlovDemux <- subset(Input, select = c("i7 Index","i5 Index", "External Identifier")) names(MacGlovDemux) <- c("forwardmid", "reversemid", "samplename") MacGlovDemux$locus <- rep(c("TRNL", "16S"),each = 1064) MacGlovDemux$project <- c("TRNL1") MacGlovDemux$wellposition <- c("") MacGlovDemux$plate <- c("") MacGlovDemux$midplate <- c("") MacGlovDemux$substrate <- c("fecal") MacGlovDemux$client_name <- c("buchanan") MacGlovDemux <- subset(MacGlovDemux, select = c(forwardmid, reversemid, locus, samplename, project, wellposition, plate, midplate, substrate, client_name)) write.csv(MacGlovDemux, "/Users/gregg/Downloads/TRNL1_Demux.csv", quote = FALSE, row.names = FALSE)