Remove an line from .txt file
#4

PHP код:
fdeleteline(filename[], removed[])
{
    new 
string[64], str[32], File:handleFile:ftmp;
    
handle fopen(filename,io_read);
    
format(str,sizeof(str),"%s.part",filename);
    
ftmp fopen(str,io_write);
    while(
fread(handle,string))
        if(
strcmp(string,removedtrue))
            
fwrite(ftmp,string);
    
fclose(handle);
    
fclose(ftmp);
    
handle fopen(filename,io_write);
    
ftmp fopen(str,io_read);
    while(
fread(ftmp,string))
        
fwrite(handle,string);
    
fclose(handle);
    
fclose(ftmp);
    return 
fremove(str);

Reply


Messages In This Thread
Remove an line from .txt file - by GospodinX - 09.08.2018, 22:05
Re: Remove an line from .txt file - by GospodinX - 10.08.2018, 15:12
Re: Remove an line from .txt file - by [WSF]ThA_Devil - 10.08.2018, 15:36
Re: Remove an line from .txt file - by jlalt - 10.08.2018, 16:19
Re: Remove an line from .txt file - by GospodinX - 10.08.2018, 19:57
Re: Remove an line from .txt file - by Logic_ - 10.08.2018, 20:19
Re: Remove an line from .txt file - by Jefff - 10.08.2018, 20:33
Re: Remove an line from .txt file - by jlalt - 11.08.2018, 16:10
Re: Remove an line from .txt file - by denNorske - 11.08.2018, 16:34
Re: Remove an line from .txt file - by GospodinX - 11.08.2018, 21:56

Forum Jump:


Users browsing this thread: 1 Guest(s)