Bom dia Walmes,
Quase deu quase certo, apenas preciso que:
Version,212
WGS1984(GPS),217,6378137,298.257223563,0,0,0 ### Dê um
espaço
USERGRID,0,0,0,0,0### Fique logo abaixo do WGS1984 sem espaço
"w." "utm." "id." "zon." "lat." "long." "id2." "d1." "h2." "n1."
"n2." "n3." "n4." "n5" ### Desapareça essa linha
"1," "w," "utm," "1," "21L," "343248," "8212396.7," "1,"
"00/00/00," "00:00:00," "0," "2," "48," "0," 13 ###
Desapareçam todos os " "
"2," "w," "utm," "2," "21L," "342784.4," "8212346," "2,"
"00/00/00," "00:00:00," "0," "2," "48," "0," 13
"3," "w," "utm," "3," "21L," "342796.2," "8212263.4," "3,"
"00/00/00," "00:00:00," "0," "2," "48," "0," 13
"4," "w," "utm," "4," "21L," "343084.7," "8212369.7," "4,"
"00/00/00," "00:00:00," "0," "2," "48," "0," 13
"5," "w," "utm," "5," "21L," "343020.3," "8212404.6," "5,"
"00/00/00," "00:00:00," "0," "2," "48," "0," 13
Segue CRM:
lat<-c(343248.0,342784.4,342796.2, 343084.7,343020.3)
long<-c(8212396.7,8212346.0,8212263.4,8212369.7,8212404.6)
coords<-cbind(lat,long)
w<-rep("w", 5)
utm<-rep("utm",5)
id<-seq(1:5)
zon<-rep("21L", 5)
id2<-seq(1:5)
d1<-rep("00/00/00",5)
h2<-rep("00:00:00",5)
n1<-rep(0,5)
n2<-rep(2,5)
n3<-rep(48,5)
n4<-rep(0,5)
n5<-rep(13,5)
dados<-cbind(w,utm,id,zon,lat,long,id2,d1,h2,n1,n2,n3,n4,n5)
dados
dados = read.table("dados.txt", dec=".", sep = ",", h=T ,col.names
= c(
"w","utm","id","zon","lat","long","id2","d1","h2","n1","n2","n3","n4","n5"))
summary(dados)
write.table(dados, file= "dados.txt", row.names= T, sep=", ",
quote=F)
dados = read.table("dados.txt", h=T)
header <-
c("Version,212\nWGS1984(GPS),217,6378137,298.257223563,0,0,0\n\n
USERGRID,0,0,0,0,0\n\n")
writeLines(text=header, con="dados_f.txt")
write.table(x=dados, file="dados_f.txt", append=TRUE)
Obrigado,
--
======================================================================
Alexandre dos Santos
Proteção Florestal
IFMT - Instituto Federal de Educação, Ciência e Tecnologia de Mato Grosso
Campus Cáceres
Caixa Postal 244
Avenida dos Ramires, s/n
Bairro: Distrito Industrial
Cáceres - MT CEP: 78.200-000
Fone: (+55) 65 8132-8112 (TIM) (+55) 65 9686-6970 (VIVO)
e-mails:alexandresantosbr@yahoo.com.br
alexandre.santos@cas.ifmt.edu.br
Lattes: http://lattes.cnpq.br/1360403201088680
======================================================================
Em 17/08/2015 09:58, Walmes Zeviani
escreveu:
Combine writeLines() com write.table().
header <- c("Walmes Zeviani\n 2015-08-17\n\n")
writeLines(text=header, con="my.txt")
write.table(x=cars, file="my.txt", append=TRUE)
À disposição.
Walmes.
_______________________________________________
R-br mailing list
R-br@listas.c3sl.ufpr.br
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo reproduzível.
_______________________________________________
R-br mailing list
R-br@listas.c3sl.ufpr.br
https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br
Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo reproduzível.