Skip to content

Instantly share code, notes, and snippets.

@dmarcelinobr
Created January 9, 2014 15:48
Show Gist options
  • Save dmarcelinobr/8336287 to your computer and use it in GitHub Desktop.
Save dmarcelinobr/8336287 to your computer and use it in GitHub Desktop.
Esse script lê todas as bases em "txt" que existir no diretório informado.
setwd("~/Documents/Data/BRAZIL/TSE")
todos.arquivos <-""
nomes.bases <- dir(path = getwd(), pattern =".txt")
for(i in 1:length(nomes.bases)){
base <- read.table(nomes.bases[i],header=TRUE, sep=";",
stringsAsFactors=FALSE)
todos.arquivos <- rbind(todos.arquivos, base)
}
write.table(todos.arquivos, file = "bases_tse.txt",sep=";",
row.names = FALSE, qmethod = "double",
fileEncoding="windows-1252")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment