How to get number of lines in text file?
#1

Hi there, i'm looking for someone to help me with this. I have a text file and I need to count number of lines in it. How do I do it?
Thanks
Reply
#2

oh, nevermind. I've just turned my brains on and think and that what I get, it works fine for me. Hope it's will be helpful for you.
Код:
new string[64], count = 0;
new File:file = fopen("houses.txt", io_read);
while(fread(file, string)) {
	count++;
}
fclose(file);
Reply
#3

kruto...=)))
Reply
#4

Quote:
Originally Posted by NiXeL
Посмотреть сообщение
oh, nevermind. I've just turned my brains on and think and that what I get, it works fine for me. Hope it's will be helpful for you.
Код:
new string[64], count = 0;
new File:file = fopen("houses.txt", io_read);
while(fread(file, string)) {
	count++;
}
fclose(file);
You just gave me an idea, thanks...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)