<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">Curiosamente funciona:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; "><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; ">reg1 <span style="color: #062599"><-</span> <span style="color: #062599">read.table(</span>file<span style="color: #062599">=</span><span style="color: #b01406">'CSV/REG0001.csv'</span><span style="color: #062599">,</span> header<span style="color: #062599">=</span><span style="color: #c38816">FALSE</span><span style="color: #062599">,</span> colClasses<span style="color: #062599">=</span> <span style="color: #062599">c(</span><span style="color: #c38816">NA</span><span style="color: #062599">,</span> <span style="color: #b01406">'POSIXct'</span><span style="color: #062599">,</span> <span style="color: #c38816">NA</span><span style="color: #062599">,</span> <span style="color: #c38816">NA</span><span style="color: #062599">,</span> <span style="color: #c38816">NA</span><span style="color: #062599">,</span> <span style="color: #c38816">NA</span><span style="color: #062599">,</span> <span style="color: #c38816">NA</span><span style="color: #062599">,</span> <span style="color: #c38816">NA</span><span style="color: #062599">),</span> sep<span style="color: #062599">=</span><span style="color: #b01406">','</span><span style="color: #062599">,</span> quote<span style="color: #062599">=</span><span style="color: #b01406">'\"'</span><span style="color: #062599">,</span> dec<span style="color: #062599">=</span><span style="color: #b01406">','</span><span style="color: #062599">)</span></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(6, 37, 153); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(6, 37, 153); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(6, 37, 153); ">Verifiquei com:</div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(6, 37, 153); "><br></div><div style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; font: normal normal normal 11px/normal Menlo; color: rgb(6, 37, 153); ">sapply(head(<span style="color: #000000">reg1</span>),<span style="color: #000000"> class</span>)</div><div><br></div><div>e obtive:</div><div><br></div><div><div>$V1</div><div>[1] "integer"</div><div><br></div><div>$V2</div><div>[1] "POSIXct" "POSIXt" </div><div><br></div><div>$V3</div><div>[1] "integer"</div><div><br></div><div>$V4</div><div>[1] "factor"</div><div><br></div><div>$V5</div><div>[1] "factor"</div><div><br></div><div>$V6</div><div>[1] "factor"</div><div><br></div><div>$V7</div><div>[1] "integer"</div><div><br></div><div>$V8</div><div>[1] "integer"</div></div><div><br></div><div><br></div></div></div></div><div><span style="color: #062599">Att.</span></div><div><span style="color: #062599"><br></span></div><div><span style="color: #062599">Alexandre</span></div><div><span style="color: #062599"><br></span></div><div><span style="color: #062599"><br></span></div><div><span style="color: #062599"><br></span></div><div><div>On Feb 22, 2012, at 10:31 PM, Leonard de Assis wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><div>Eu pensei em usar scan direto, mas eu ia acabar tendo que escrever o<br>parser na mão. Achei mais prático e rápido o jeito lento, lendo tudo<br>como string e convertendo a posteriori, nem arrisquei o outro jeito.<br><br> Este era o csv 1 de 202, eu tenho que dar merge neles depois para<br>analisar. Ao todo vai ficar pequeno, pois em csv, ocupam 780mb do hd<br><br>em suma: são 550 mil registros cada um, sendo que no meio do caminho,<br>algumas políticas de coleta mudam (vide a data)<br><br>amanhã, com calma, descrevo o problema na lista mundial, eheheh<br><br>[]s<br>Leonard de Assis<br>assis <dot> leonard <at> gmail <dot> com<br><br><br>Em 22/02/2012 22:16, Benilton Carvalho escreveu:<br><blockquote type="cite">acho q vale um forward da sua pergunta p r-help... vai q tem um jeito<br></blockquote><blockquote type="cite">q nao estamos enxergando... :)<br></blockquote><blockquote type="cite"><br></blockquote><blockquote type="cite">2012/2/23 Leonard de Assis <<a href="mailto:assis.leonard@gmail.com">assis.leonard@gmail.com</a>>:<br></blockquote><blockquote type="cite"><blockquote type="cite">Benilton,<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">em teoria era pra funcionar sem precisar desta "Gambiarra". Acho até<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">legal consultar o 'Core team' sobre este pequeno inconveniente, acredito<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">que seja merecedor de uma implementação para suprir este problema (O CSV<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">foi gerado pelo Oracle e supostamente estava em um padrão ISO)<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Fazendo em 2 etapas funcionou bem. Levou o dobro do tempo, mas funcionou.<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">[]s<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Leonard de Assis<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">assis <dot> leonard <at> gmail <dot> com<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite">Em 22/02/2012 20:23, Benilton Carvalho escreveu:<br></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">putz... isso eh inconveniente... a avaliacao das classes ta<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">acontecendo antes da avaliacao do quote... =/<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">faca em dois passos:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">1) use o read.table() sem colClasses, mas usando stringsAsFactors=FALSE<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">2) converta as colunas relevantes para factor e POSIXct<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">b<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">2012/2/22 Leonard de Assis <<a href="mailto:assis.leonard@gmail.com">assis.leonard@gmail.com</a>>:<br></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Possuo um csv (+- 350 000 registros) com a seguinte 'xara':<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"137831","4/12/2006 17:30:47","0","ENTRE 50 e 100","","","-1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"137549","4/12/2006 11:13:26","0","ENTRE 50 e 100","","","-1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"137936","4/12/2006 19:58:57","0","ENTRE 50 e 100","","","-1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"137661","4/12/2006 13:51:43","0","ENTRE 50 e 100","","","-1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"138046","4/12/2006 23:35:00","0","ENTRE 100 e 200","","","-1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"140275","8/12/2006 17:15:22","0","ENTRE 50 e 100","","","-1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"137837","4/12/2006 17:36:06","0","ENTRE 50 e 100","","","-1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"138210","5/12/2006 12:02:20","0","ENTRE 50 e 100","","","-1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">depois de alguns milhares de regístros (105296 regístros depois), ele<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">adquire o seguinte formato:<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"2144767","6/3/2008","0","ENTRE 1600 e 3200","LJ","SITE","1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"2144768","6/3/2008","0","ENTRE 200 e 400","LJ","SITE","1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"2144769","6/3/2008","0","ENTRE 100 e 200","LJ","SITE","2","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"2144770","6/3/2008","0","ENTRE 200 e 400","LJ","SITE","1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"2144771","6/3/2008","0","ENTRE 400 e 800","LJ","TVEN","1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"2144772","6/3/2008","0","ENTRE 200 e 400","LJ","SITE","1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"2144773","6/3/2008","0","ENTRE 100 e 200","LJ","SITE","1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"2144774","6/3/2008","0","ENTRE 400 e 800","LJ","SITE","1","1"<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">mas o problema não chegou a ser essa mudança repentina no formato da data<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">(creio que existirá um sério problema referente a isto ainda), o problema é<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">um pouco antes:<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">rodei o seguinte código:<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">reg1 <- read.table(<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> file="CSV/REG0001.csv",<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> header=FALSE,<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> colClasses= c('integer', 'POSIXct', 'integer', 'factor', 'factor',<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">'factor', 'integer', 'integer'),<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> sep=',', quote='\"', dec=',' )<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">aí, ao executar, sou surpreendido com o seguinte erro:<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Error in scan(file, what, nmax, sep, dec, quote, skip, nlines, na.strings,<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">:<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"> scan() expected 'an integer', got '"155638"'<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">"155638" é a 1ª linha, 1ª variável do CSV<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">aí vem a pergunta: Como fazer o R entender que precisa ignorar estas '"' ao<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">ler o csv?<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">--<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">[]s<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Leonard de Assis<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">assis <dot> leonard <at> gmail <dot> com<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">_______________________________________________<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">R-br mailing list<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><a href="https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br">https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br</a><br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">Leia o guia de postagem (<a href="http://www.leg.ufpr.br/r-br-guia">http://www.leg.ufpr.br/r-br-guia</a>) e forneça código<br></blockquote></blockquote></blockquote></blockquote><blockquote type="cite"><blockquote type="cite"><blockquote type="cite"><blockquote type="cite">mínimo reproduzível.<br></blockquote></blockquote></blockquote></blockquote>_______________________________________________<br>R-br mailing list<br><a href="mailto:R-br@listas.c3sl.ufpr.br">R-br@listas.c3sl.ufpr.br</a><br>https://listas.inf.ufpr.br/cgi-bin/mailman/listinfo/r-br<br>Leia o guia de postagem (http://www.leg.ufpr.br/r-br-guia) e forneça código mínimo reproduzível.<br></div></blockquote></div><br></body></html>