Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => General

PHP CUT and FILTER

Ask about general coding issues or problems here.

Moderators: macek, egami, gesf

PHP CUT and FILTER

Postby navsan » Sat Jan 12, 2013 8:27 am

Hi All,

i have a log file .i want to cut and filter using some conditions in PHP
condition 1:first i want to filter the datas having "P12345"
condition 2:cut the session ID and time stamp(i.e 77087432[11/29/2012 08:57:02])for all user id "P12345"

Code: Select all
P123456_77087432[11/29/2012 08:57:02]:INFO: login
P123456_77087432[11/29/2012 08:57:02]:INFO:UpdateInfo o
P12345_WorkItemID = 1-ASSDFDFS##1232134214_0386052691
P123456_77087432[11/29/2012 09:05:37]:ERROR:Failed on invoking GetWoritem
P12345_WorkItemID = 1-ASSDFDFS##1232134214_0386052691
P123456_77087432[11/29/2012 09:05:37]:ERROR:Unable to retrive work item ibute
P123456_77087432[11/29/2012 09:05:37]:WARNING:Failed at RenderFormatString,
P12345_WorkItemID = 1-ASSDFDFS##1232134214_0386052691
P12345_WorkItemID = 1-ASSDFDFS##1232134214_0386052691
P123456_77087432[11/29/2012 09:05:37]:WARNING:RenderFormatString: Could not find
P123456_77087432[11/29/2012 09:05:37]:WARNING:RenderFormatString: Could not find
P123456_77087432[11/29/2012 09:05:37]:WARNING:RenderFormatString: Could not find


and the out put should be like this


Code: Select all
77087432[11/29/2012 08:57:02]
77087432[11/29/2012 08:57:02]
77087432[11/29/2012 09:05:37]
77087432[11/29/2012 09:05:37]
77087432[11/29/2012 09:05:37]
77087432[11/29/2012 09:05:37]
77087432[11/29/2012 09:05:37]
77087432[11/29/2012 09:05:37]
navsan
New php-forum User
New php-forum User
 
Posts: 1
Joined: Sat Jan 12, 2013 8:22 am

Return to PHP coding => General

Who is online

Users browsing this forum: Bing [Bot] and 2 guests

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.

cron