Re: Stripping!!!

From: Date: Thu, 11 Jan 2001 16:30:21 +0000
Subject: Re: Stripping!!!
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-34034@lists.php.net to get a copy of this message
Ok Robin, Many Thx! *********** REPLY SEPARATOR *********** On 11/01/2001 at 16:13 Robin Vickery wrote: >>>>>> "S" == "K Simon" <phpsoft@zabia.net> writes: > > > Thx, but could anybody give me an example? It shouldnt be too hard?! > > >If you feel you have to do it in php then this should work. You'd save >a lot of effort if you used the unix 'cut' command though. > >cut -d ' ' -f 1 inputfile.txt > outputfile.txt > >is equivalent to (but considerably faster than) this: > ><?php > >$in_file = fopen( "inputfile.txt", "r" ) or die( "failed to open >input file." ); >$out_file = fopen( "outputfile.txt", "w" ) or die( "failed to open >output file." ); > >while ( !feof($in_file) ) { > fwrite( $out_file, strtok(fgets($in_file, 1024), " ") . "\n"); >} > >fclose ($in_file); >fclose ($out_file); > >?> > > >-- >Still nothing > >-- >PHP General Mailing List (http://www.php.net/) >To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net >For additional commands, e-mail: php-general-help@lists.php.net >To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#34034) next »