Count strings in a file
#1

Hey, i don't know how to count strings in a text file, i need to get the number to use it in a loop. If some of you can help me i'd be thankful :3
Reply
#2

How're you separating strings? If you're separating them one on each line, maybe you can just count the lines

HTML Code:
new string[64], count = 0;
new File:file = fopen("houses.txt", io_read);
while(fread(file, string)) {
	count++;
}
fclose(file);
Reply
#3

I didn't read well fread function before posting xD, thanks anyway
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)