| 
	
 | 
 Posted by macbri on 08/29/05 23:35 
kerul4u Wrote:  
> Instead of using preg_split why not trying to reading and writing file 
>  
> --snip-- 
> //Array of special charecters you want to replace 
> $special = 
> array('DST-NUMBER-IN=','DST-NUMBER-OUT=','DST-NUMBER-BILL='); 
> $replacements = ""; 
>  
> $string = str_replace($special,$replacements,$string); 
> --snip-- 
 
Not a bad idea, but if you look at the contents of the OP's actual file 
there's a lot of other stuff in there.  Especially dates, IP addresses 
etc.  Your array of special characters might become a bit unwieldy: 
 
>  
> Sat Aug 20 10:59:31 2005, HOST=xxx.xxx.xxx.xxx, 
> DST-NUMBER-IN=003351xxxxxxxx, DST-NUMBER-OUT=98751#33512xxxxxxxx, 
> DST-NUMBER-BILL=003351xxxxxxxx, SRC-IP=xxx.xxx.xxx.xxx:1456, 
> DST-IP=xxx.xxx.xxx.xxx.246:1720, SRC-USER=125, DST-USER=easylink, 
> SRC-NAME=U11, DST-NAME=easylink, DIALPEER-NAME=R30, 
> INITIAL-INCOMING-LOCAL-ADDRESS=xxx.xxx.xxx.xxx, 
> SELECTED-INCOMING-LOCAL-ADDRESS=xxx.xxx.xxx.xxx, 
> OUTGOING-LOCAL-ADDRESS=xxx.xxx.xxx.xxx, RECORD-ID=1124534625-0, 
> ELAPSED-TIME=0, SETUP-TIME=10:59:31.000 GMT Sat Aug 20 2005, 
> CONNECT-TIME=10:59:31.000 GMT Sat Aug 20 2005, 
> DISCONNECT-TIME=10:59:31.000 GMT Sat Aug 20 2005, 
> DISCONNECT-CODE-LOCAL=2, DISCONNECT-CODE-Q931=1, SRC-BYTES-IN=604, 
> DST-BYTES-IN=95, SRC-BYTES-OUT=0, DST-BYTES-OUT=630, QOS=0, 
> SRC-CODEC=g729B g729 g729AwB g729A g7231 gsmFR g711U64k g711A64k , 
> CALLID=0221d499c177861a56343xxxxxxxxxxxx, 
> CONFID=0221d499c17bc32456343xxxxxxxxxx, PROXY-MODE=1, ROUTE-RETRIES=1 
 
But, based on the OP's latest reply, I guess he/she has a solution that 
works, so the point is moot now anyway :) 
 
 
--  
macbri 
------------------------------------------------------------------------ 
macbri's Profile: http://www.macosx.com/forums/member.php?userid=34415 
View this thread: http://www.macosx.com/forums/showthread.php?t=242019 
macosx.com - The Answer to Mac Support - http://www.macosx.com
 
[Back to original message] 
 |