SA-MP Forums Archive
Editing a specific line using files functions - 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)
+--- Thread: Editing a specific line using files functions (/showthread.php?tid=537911)



Editing a specific line using files functions - ranme15 - 18.09.2014

Hello,

Is that possible to edit a specific line using file functions? here is an example:
Код:
1,test
2,test
3,test
I wanna edit only the 2nd line, how can I do that using file functions?


Re: Editing a specific line using files functions - ranme15 - 18.09.2014

Quote:
Originally Posted by ******
Посмотреть сообщение
You need to read the whole file in, write out lines you don't want to edit, edit and write out the line you want to change, then read in and write out the remainder of the file. This is not that easy, and the reason most people use libraries.
I don't need it as "name=value", that is why I don't use a library. Anyways, thanks for your answer.


Re: Editing a specific line using files functions - ranme15 - 18.09.2014

Quote:
Originally Posted by ******
Посмотреть сообщение
I didn't say an INI library, just a library.
What kind of library supports that way?