[HELP] Delete line from file
#1

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 .
Reply
#2

I need help
Reply
#3

Help me please
Reply
#4

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


Forum Jump:


Users browsing this thread: 1 Guest(s)