reading lines from .txt ->strange crash

Blitz3D Forums/Blitz3D Programming/reading lines from .txt ->strange crash

Dimas(Posted 2010) [#1]
I have this program:



but it crashed while reading the file "test.txt" (you can download it from http://www.ampostata.org/misc/test.rar )

and I dont know why. I have made several tests and checked the file, and found no reason why it should crash, at least where it does it.

Any hint?

Thank you.

Oh, I am using Win7 64 bits, if this helps.

PD: testes on XP64, and it also crashes...


Charrua(Posted 2010) [#2]
is 10 megas!

i open it with: notepad, wordpad and word, at first seems to be ok, buy if you try to go to the end (Ctrl+End) all three programs hangs!
(hangs too from blitz)
is late at night here, tomorrow will see

Juan


MusicianKool(Posted 2010) [#3]
notepad ++ handles it just fine on a P3 laptop XP.


Dimas(Posted 2010) [#4]
As you see, it is a premiere project.

I edit videos on HD, but as they are very cpu intensives, I first translate the HD clips to AVI.DV ones. I edited, and when finish, I did a search&replace of some texts inside the project, so I can open this on Premiere as if it was native-edited in HD.

The problem is that wordpad takes ages (I mean, around 30 minutes) just to change all ".avi" to ".mts".

My program takes less than a minute... before crashing.

Juan, bonico, a ver si dieras con la teclaaaaa!!!!

Can be some problem related to Blitz variable buffer?


Serpent(Posted 2010) [#5]
This isn't to do with your blitz program, but I second 'Notepad++'. It handles large files very well with easy Find & Replace options - I used it on a Premiere project myself a few weeks ago.


MusicianKool(Posted 2010) [#6]
well my blitz crashes on my laptop at about 29 % - 30 %. i had a look at the file at that mark and found that line 74692 is not only extremely long but seems to have some characters I've never seen before at the end of it. blitz always seems to crash right before this line, I will try to remove it and re run the program . also that line makes notepad++ act very sluggish.
... Yep remove line 74692 in the test file and it works just fine.

I will see if you can skip over the line or if it has to be deleted.


MusicianKool(Posted 2010) [#7]
OMG lol, just saw how big line 74692 is.... its over 7mb no wonder blitz crashes. Cant just skip over it either, once its in the streambuffer that's it for blitz. maybe you can cut that line out and paste it back in later.


Serpent(Posted 2010) [#8]
if you wanted to ensure that the program doesn't encounter difficulties, you could try writing something that reads bytes rather than lines. It would still be possible to do replaces, but at least blitz won't try to read 7mb lines at once...


Dimas(Posted 2010) [#9]
I have in mind the solution, but I think it is too much effort...

Yes, I am lazy.

Thank you guys, anyway.