Raised This Month: $248 Target: $400
 62% 

Using fgets/parse for files with different formats


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MaNaReaver
Member
Join Date: Apr 2020
Location: India
Old 09-03-2020 , 09:01   Using fgets/parse for files with different formats
Reply With Quote #1

Hey AM,

I had two sorts of files with formats: [Mapname] and [Mapname] [Info]. I was trying to use fgets for this, and wanted to know whether fgets reads just a single line at a time, or can it skip to another line (as fgets detects a newline character) while reading the file? Should I use parse instead, and will parse read only one line at a time?

Best regards,
MaNaReaver.
__________________
MaNaReaver is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 09-03-2020 , 16:52   Re: Using fgets/parse for files with different formats
Reply With Quote #2

http://www.amxmodx.org/api/file/fgets

Use fgets to read the entire line and then parse when needed.
__________________
Bugsy is offline
MaNaReaver
Member
Join Date: Apr 2020
Location: India
Old 09-05-2020 , 19:15   Re: Using fgets/parse for files with different formats
Reply With Quote #3

Quote:
Originally Posted by Bugsy View Post
http://www.amxmodx.org/api/file/fgets

Use fgets to read the entire line and then parse when needed.
Thanks Bugsy, I was unable to differentiate between the two, and now I understand
__________________
MaNaReaver is offline
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

Forum Jump


All times are GMT -4. The time now is 09:27.


Powered by vBulletin®
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Theme made by Freecode