SA-MP Forums Archive
[HELP] Delete line from 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: [HELP] Delete line from file (/showthread.php?tid=159701)



[HELP] Delete line from file - tbx - 14.07.2010

Hi, i am scripting script, it have to do delete line from soubor
for example : DelLine("testfile.txt","DelThisLine",10); //it have to delete word "DelThisLine" .. it doesn'n delete now it is just writing to console, but my problem is >

in file is :
hallo
DelThisLine
bye

and it will printf this .. i want to print just

hallo
bye .. code is here

Код:
  stock DelLine(dir[],word[],linesInFolder)
{
new File:oldF;
//new File:CopyF;
//new File:completedF;
new Line;

oldF = fopen(dir,io_read);
//CopyF = fopen("lRemoveDir.txt",io_append);

	new output[256];
	if (oldF)
	{
		while (fread(oldF, output))
		{
			if(Line < linesInFolder+2)
			{
	        	if(strcmp(output,word,false))
	        	{
 				printf(output);
 				Line ++;
 			    }
 			}
 		
		} fclose(oldF);
	}
return 1;
}
Have a nice day .


Re: [HELP] Delete line from file - tbx - 08.08.2010

I need help


Re: [HELP] Delete line from file - tbx - 12.08.2010

Help me please


Re: [HELP] Delete line from file - Jefff - 12.08.2010

http://forum.sa-mp.com/search.php?searchid=263247
First topic with my post.