-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRecompileOnly.R
33 lines (27 loc) · 1.41 KB
/
RecompileOnly.R
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/bin/env Rscript
# Dependencies
library('data.table')
library('english')
library('stringr')
library('stringi')
library('Hmisc')
library('NCmisc')
rm(list=ls())
rawb <- read.csv("./bibletaxonomy.csv", stringsAsFactors = FALSE, header = FALSE, col.names = c('book','chapter','verse')) #Read main list
books <- unique(rawb$book)
master <- c()
for (i in 1:length(books)) {
b <- books[i]
setb <- rawb[rawb$book == b,]
b <- gsub(' ', '', b)
fn <- paste('./Lists/', b, ".txt", sep="")
master <- c(master, read.table(fn, header = FALSE, stringsAsFactors = FALSE))
print(paste0('Read ',b))
}
master <- unlist(master, use.names = FALSE)
master <- c(master, unlist(read.table(paste('./Lists/SpecialMaster.txt', sep=""), header = FALSE, stringsAsFactors = FALSE), use.names = FALSE), unlist(read.table(paste('./Lists/Years.txt', sep=""), header = FALSE, stringsAsFactors = FALSE), use.names = FALSE), unlist(read.table(paste('./Lists/NumbersOnly.txt', sep=""), header = FALSE, stringsAsFactors = FALSE), use.names = FALSE), unlist(read.table(paste('./Lists/Jesus.txt', sep=""), header = FALSE, stringsAsFactors = FALSE), use.names = FALSE))
master <- unique(master)
final.file <- file(paste('./BiblePass.txt', sep=""), "wb")
write.table(data.table(master), final.file, col.names = FALSE, row.names = FALSE, quote = FALSE)
close(final.file)
file.split(paste('./BiblePass.txt', sep=""), size=900000, same.dir=TRUE, verbose=FALSE)