SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 23/01/2020, 06:53 PM   #1
KehmoSabeh
Little Clucker
 
KehmoSabeh's Avatar
 
Join Date: Feb 2017
Location: Chile
Posts: 11
Reputation: 0
Default Count strings in a file

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
__________________
__________________________________________________ _____
KehmoSabeh is offline   Reply With Quote
Old 23/01/2020, 10:32 PM   #2
Markski
Big Clucker
 
Markski's Avatar
 
Join Date: Apr 2015
Location: La Plata, Argentina
Posts: 133
Reputation: 59
Default Re: Count strings in a file

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);
Markski is offline   Reply With Quote
Old 25/01/2020, 04:56 PM   #3
KehmoSabeh
Little Clucker
 
KehmoSabeh's Avatar
 
Join Date: Feb 2017
Location: Chile
Posts: 11
Reputation: 0
Default Re: Count strings in a file

I didn't read well fread function before posting xD, thanks anyway
__________________
__________________________________________________ _____
KehmoSabeh is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Get Strings in file and connect it to other file Lirbo Scripting Help 26 10/08/2014 03:32 PM
Load strings with file.inc or yini from file. DiNorscio Scripting Help 13 26/06/2014 06:01 PM
Adding new strings to an existing INI file rhds Scripting Help 5 25/03/2013 07:42 PM
[Tool/Web/Other] [PHP]Count strings very easy! zSuYaNw Tools and Files 35 15/03/2011 07:32 PM
Extracting strings from a file. Whizion Help Archive 7 14/01/2011 01:59 PM


All times are GMT. The time now is 08:01 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.