#212619 - 2017-08-14 04:15 AM
ReadLine()
|
AndreLuiz
Getting the hang of it
Registered: 2015-10-07
Posts: 92
Loc: Brasil, João pessoa
|
[ptbr] Olá a todos, eu vim até aqui para compartilhar algo que me incomodou bastante. É o seguinte, eu rodei um while, para capturar os dados de um arquivo com 4,419 linhas, e nesse momento ele levou 4s e 159ms, e para o que preciso é uma enorme tristeza. Enfim ai eu resolvi, testar uma coisa nova, usar o wshpipe() para ver a velocidade. então ele levou uns 344ms, podem testar se quiser.
Conclusão se o arquivo for grande, melhor usar o wshpipe para isso.
[eng(TRANSLATE)] Hello everyone, I came here to share something that bothered me a lot. This is the following, I ran a while, to capture data from a file with 4,419 lines, and at that point it took 4s and 159ms, and what I need is a huge sadness. Anyway, I decided to test something new, use wshpipe() to see the speed. So it took about 344ms, you can test if you want.
Conclusion If the file is large, best use wshpipe for this.
Codes:
/* READLINE() */
$handle=freefilehandle()
$=Open($handle, $Dir)
$Dir = ''
while (@error = 0)
$Dir = $Dir + ReadLine($handle) + @crlf
loop
$=Close($handle)
$Dir = Split($Dir, @crlf)
$Dir = Wshpipe('%comspec% /c Type "$Dir"', 1)
[ptbr] Não sei se mais alguém já sabia disso, mas é sempre bom trazer essas informações. Acho que vou poder na área de sugestões, algo do tipo, adicionar um ReadAll($handle, @crlf). Onde o primeiro parâmetro seria o id, e o segundo parâmetro seria o delimitador para as linhas.
[eng(TRANSLATE)] I do not know if anyone else already knew this, but it's always good to bring this information. I think I'll be able to in the area of suggestions, something like, add a ReadAll($handle, @crlf). Where the first parameter would be the id, and the second parameter would be the delimiter for the rows.
|
|
Top
|
|
|
|
Moderator: Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart
|
0 registered
and 1343 anonymous users online.
|
|
|