[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


Messages In This Thread
[HELP] Delete line from file - by tbx - 14.07.2010, 08:13
Re: [HELP] Delete line from file - by tbx - 08.08.2010, 07:13
Re: [HELP] Delete line from file - by tbx - 12.08.2010, 16:45
Re: [HELP] Delete line from file - by Jefff - 12.08.2010, 17:29

Forum Jump:


Users browsing this thread: 1 Guest(s)