SA-MP Forums Archive
[RESOLVED] How read a section of a file? - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [RESOLVED] How read a section of a file? (/showthread.php?tid=73542)



[RESOLVED] How read a section of a file? - Nubotron - 16.04.2009

Hi,

I want read only a section of a file, delimited with a start and a end, exemple:

Код:
section1_start
s1_line1
s1_line2
section1_end
section2_start
s2_line1
s2_line2
s2_line3
section2_end
section3_start
s3_line1
section3_end
For exemple, I want read only section2 lines:
Код:
s2_line1
s2_line2
s2_line3
How to do this? thanks


Re: How read a section of a file? - Backwardsman97 - 16.04.2009

This is how ini files are setup. Since the wiki is currently down, go to ******.com and type in "wiki.sa-mp ini" (no quotes), and hit cached on the first link. Read that. It will tell you everything you need to know and show you some example code. I wish I could link you but it's down right now.


Re: How read a section of a file? - Nubotron - 16.04.2009

Thank, but what i want to do is different of INI file,

I want read and work with all lines between section2_start and section2_end.
Lines are not in format "key = value", but "value, value, value, value"

How to write.. i don't have words to explain

Edit: i have found! It was easy