plz help me i wanna read following to capture some specify values... plz hepl me


&l4H

(s3B (s16901T (s12HCharges Summary For the Mobile Service No 0712069069
(Mr. . .) of Account 1863480
_________________________________________________________________________________

Service Package Description : Corporate package for 750 CommBill No : 7810912
(s0B
&d#DCall charges &d@
Outgoing Calls - 750SP-1 25/04 - 24/05 931.00

(s3B
TOTAL CALL CHARGES ...................... 931.00
(s0B
&d#DValue added services usage &d@
Mtunes - 750SP-1 25/04 - 24/05 30.00

Outgoing SMS - 750SP-1 25/04 - 24/05 47.00

(s3B
TOTAL OF VAS ...................... 77.00
(s0B
&d#DMonthly subscriptions &d@
VPN Subscriptio - TRC 100.00

Package - 750SP-1 25/04 - 23/06 200.00

Mtunes Subscrip - TRC 50.00

(s3B
TOTAL OF SUBSCRIPTIONS ...................... 350.00
(s0B
(s3B
________________
Total Charges for the Mobile No 0712069069 1,358.00
________________
(s0B

&l0O (s3B (s16901T (s12H Bill No : 7810912 0712069069- 1
Call Charge Details for Mobile No : 0712069069 of Account 1863480
_________________________________________________________________
From : Apr 25 08 To : May 24 08

Date and Time Origin Phone Number Units Charge
mmm dd yy HH:MM:SS Charged In Rs.
(s0B
Outgoing Call
______________
Apr 25 08 08:35:15 0772015067 P 2 10.00
09:10:02 0777791678 P 1 5.00
09:39:41 0714352743 P 3 6.00
09:59:13 0773451458 P 1 5.00
15:06:47 0772015064 P 1 5.00
17:58:08 0715590902 P 1 2.00
19:10:16 0722452235 O 7 35.00
Apr 26 08 07:52:28 0115768944 O 1 5.00
07:55:25 0115768944 O 1 5.00

&l0O (s3B (s16901T (s12H Bill No : 7810912 0712069069- 2
Call Charge Details for Mobile No : 0712069069 of Account 1863480
_________________________________________________________________
From : Apr 25 08 To : May 24 08

Date and Time Origin Phone Number Units Charge
mmm dd yy HH:MM:SS Charged In Rs.
(s0B
May 03 08 08:47:30 0772015065 P 2 10.00
08:49:26 0112762563 P 1 5.00
09:16:58 0772015067 P 2 10.00
13:35:37 0772015061 P 1 5.00
(s3B
Charge for Outgoing Call in Rs. (s16901T (s12H (s1S &d#D (s3B 931.00 &d@
&l0O (s3B (s16901T (s12H Bill No : 7810912 0712069069- 3
Call Charge Details for Mobile No : 0712069069 of Account 1863480
_________________________________________________________________
From : Apr 25 08 To : May 24 08

Date and Time Origin Phone Number Units Charge
mmm dd yy HH:MM:SS Charged In Rs.
(s0B
(s16901T (s12H (s1S &d#D (s3B TOTAL FREE CALLS - 0 FREE UNITS USED - &d@
(s0B
SMS Outgoing
______________
Apr 25 08 21:53:07 0716855460 1 1.00
22:05:59 0716855460 1 1.00
May 02 08 20:08:33 0716855460 1 1.00

19:49:52 0716855460 1 1.00
May 18 08 01:22:00 0716855460 1 1.00
01:38:29 0716855460 1 1.00
06:57:32 0716855460 1 1.00
(s3B
Charge for SMS Outgoing in Rs. (s16901T (s12H (s1S &d#D (s3B 47.00 &d@
(s16901T (s12H (s1S &d#D (s3B TOTAL FREE CALLS - 0 FREE UNITS USED - &d@
(s0B

&l0O (s3B (s16901T (s12H Bill No : 7810912 0712069069- 4
Call Charge Details for Mobile No : 0712069069 of Account 1863480
_________________________________________________________________
From : Apr 25 08 To : May 24 08

Date and Time Origin Phone Number Units Charge
mmm dd yy HH:MM:SS Charged In Rs.
(s0B
Mtunes
______________
May 04 08 11:00:11 0 30.00
(s3B
Charge for Mtunes in Rs. (s16901T (s12H (s1S &d#D (s3B 30.00 &d@
(s16901T (s12H (s1S &d#D (s3B TOTAL FREE CALLS - 0 FREE UNITS USED - &d@
(s0B
(s3B
Total Call Charge in Rs. 1008.00
____________
(s0B
TOTAL CALL CHARGES ...................... 10.00
(s0B
&d#DMonthly subscriptions &d@
Package - 750SP-1 09/05 - 23/06 153.33

VPN Subscriptio - TRC 100.00

(s3B
TOTAL OF SUBSCRIPTIONS ...................... 253.33
(s0B
(s3B
________________
Total Charges for the Mobile No 0712570570 263.33
________________
(s0Bl0O (s3B (s16901T (s12H Bill No : 7810912 0712570570- 1
Call Charge Details for Mobile No : 0712570570 of Account 1863480
_________________________________________________________________
From : Apr 25 08 To : May 24 08

Date and Time Origin Phone Number Units Charge
mmm dd yy HH:MM:SS Charged In Rs.
(s0B
Outgoing Call
______________
May 11 08 21:41:19 0774737611 O 1 5.00
May 23 08 19:38:53 0777316209 O 1 5.00
(s3B
Charge for Outgoing Call in Rs. (s16901T (s12H (s1S &d#D (s3B 10.00 &d@
(s16901T (s12H (s1S &d#D (s3B TOTAL FREE CALLS - 0 FREE UNITS USED - &d@
(s0B
(s3B
Total Call Charge in Rs. 10.00
____________
(s0B

(s3B (s16901T (s12HCharges Summary For the Mobile Service No 0712595958
(Mr.) of Account 1863480
_________________________________________________________________________________

Service Package Description : Corporate package for 750 CommBill No : 7810912
(s0B
&d#DCall charges &d@
DIV Call Chrg. - 750SP-1 25/04 - 24/05 2.00

Outgoing Calls - 750SP-1 25/04 - 24/05 942.00

(s3B
TOTAL CALL CHARGES ...................... 944.00
(s0B
&d#DValue added services usage &d@
Outgoing SMS - 750SP-1 25/04 - 24/05 9.00

(s3B
TOTAL OF VAS ...................... 9.00
(s0B
&d#DMonthly subscriptions &d@
VPN Subscriptio - TRC 100.00

Package - 750SP-1 25/04 - 23/06 200.00

(s3B
TOTAL OF SUBSCRIPTIONS ...................... 300.00
(s0B
(s3B
________________
Total Charges for the Mobile No 0712595958 1,253.00
________________
(s0Bl0O (s3B (s16901T (s12H Bill No : 7810912 0712595958- 1
Call Charge Details for Mobile No : 0712595958 of Account 1863480
_________________________________________________________________
From : Apr 25 08 To : May 24 08

Date and Time Origin Phone Number Units Charge
mmm dd yy HH:MM:SS Charged In Rs.
(s0B
Outgoing Call
______________
Apr 25 08 08:29:00 0773956228 P 1 5.00
09:12:34 0772510753 P 1 5.00
10:48:06 0773956228 P 1 5.00
12:01:00 0775440184 P 1 5.00
12:35:38 0775339803 P 1 5.00
17:16:26 0774173203 P 1 5.00
17:46:17 0786518108 P 1 5.00
May 03 08 10:22:33 0777572428 P 3 15.00
10:26:10 0115516676 P 1 5.00
11:08:07 0112599280 P 1 5.00
11:09:13 0112697111 P 1 5.00
15:34:46 0786518108 O 1 5.00
May 04 08 14:45:01 0714391664 O 1 3.00
&l0O (s3B (s16901T (s12H Bill No : 7810912 0712595958- 2
Call Charge Details for Mobile No : 0712595958 of Account 1863480
_________________________________________________________________
From : Apr 25 08 To : May 24 08

Date and Time Origin Phone Number Units Charge
mmm dd yy HH:MM:SS Charged In Rs.
(s0B
13:13:00 0112372001 P 1 5.00
14:58:08 0774357700 P 2 10.00
16:22:13 0786178668 P 1 5.00
May 06 08 14:42:06 0115516676 P 1 5.00
15:38:00 0115516676 P 2 10.00
17:54:28 0774357700 P 1 5.00
19:39:52 0415783047 O 1 5.00
20:10:33 0415783047 O 3 15.00
May 07 08 12:33:34 0771629440 P 1 5.00
12:46:40 0771629440 P 1 5.00
14:44:16 0776091993 O 1 5.00
19:18:02 0786518108 O 1 5.00
May 14 08 14:05:51 0785792992 P 1 5.00
14:49:43 0773791891 P 1 5.00
l0O (s3B (s16901T (s12H Bill No : 7810912 0712595958- 3
Call Charge Details for Mobile No : 0712595958 of Account 1863480
_________________________________________________________________
From : Apr 25 08 To : May 24 08

Date and Time Origin Phone Number Units Charge
mmm dd yy HH:MM:SS Charged In Rs.
(s0B
16:20:25 0773350999 P 2 10.00
16:25:49 0773350999 P 1 5.00
21:03:02 0786518108 O 1 5.00
May 16 08 09:54:31 0773956937 P 1 5.00
09:58:44 0779677936 P 1 5.00
15:51:01 0715445426 P 2 4.00
16:36:21 0716665087 P 1 2.00
21:43:40 0775735511 O 8 40.00
May 22 08 08:11:23 0786518108 P 1 5.00
10:49:00 0774973655 P 1 5.00
11:47:47 0775559666 P 3 15.00
12:44:33 0773334323 P 1 5.00
15:51:37 0716665087 P 1 2.00
18:08:01 0786518108 O 1 5.00
18:12:00 0786518108 O 1 5.00
18:35:22 0786518108 O 1 5.00
(s3B
Charge for Outgoing Call in Rs. (s16901T (s12H (s1S &d#D (s3B 942.00 &d@
(s16901T (s12H (s1S &d#D (s3B TOTAL FREE CALLS - 0 FREE UNITS USED - &d@
(s0B
l0O (s3B (s16901T (s12H Bill No : 7810912 0712595958- 4
Call Charge Details for Mobile No : 0712595958 of Account 1863480
_________________________________________________________________
From : Apr 25 08 To : May 24 08

Date and Time Origin Phone Number Units Charge
mmm dd yy HH:MM:SS Charged In Rs.
(s0B
Diverted Call
______________
May 12 08 10:31:10 0714701701 P 1 2.00
(s3B
Charge for Diverted Call in Rs. (s16901T (s12H (s1S &d#D (s3B 2.00 &d@
(s16901T (s12H (s1S &d#D (s3B TOTAL FREE CALLS - 0 FREE UNITS USED - &d@
(s0B
SMS Outgoing
______________
May 02 08 15:08:15 0715330696 1 1.00
15:20:32 0715330696 1 1.00
May 06 08 09:18:42 0714663311 1 1.00
09:18:52 0714663311 1 1.00
09:18:58 0714663311 1 1.00
May 24 08 13:08:44 0786518108 1 2.00
14:25:53 0786518108 1 2.00
(s3B
Charge for SMS Outgoing in Rs. (s16901T (s12H (s1S &d#D (s3B 9.00 &d@
(s16901T (s12H (s1S &d#D (s3B TOTAL FREE CALLS - 0 FREE UNITS USED - &d@
(s0B
(s3B
Total Call Charge in Rs. 953.00
____________
(s0B

i want select only following values as array...

Mobile 0712069069
Outgoing Calls 931.00
Mtunes 30.00
Outgoing SMS 47.00
VPN Subscriptio 100.00
Package - 200.00
Mtunes Subscrip 50.00

open the file using fopen(), fread(), and fclose(). then parse the contents with a regex and the preg_match function.

all of this with examples can be found at www.php.net

i try to solve this but coudnt since im new to php. i can only read full text file. but i want select chargers for purticler mobile..

do a google search for php regex. you should find a lot of information about how to do this.

I tried sevaral way. but i was fail.. plz help me to read this.. then il do all part

if text file follow------
asdadad asdad Service No 0712069069 cacacggcacca asdadad asdad Service No 0716855455 cacacggcacca
-----
i want get out put as

Service No 0712069069
Mobile : 0712069069
Service No 0716855455
Mobile : 0716855455

plz give script to get out put from my text then i can do other parts plz... i tried to do this more than 24hrs sitting my seat with out going any where

ryan_vietnow , kkeith29 thans u both i learn much since u. plz do help me

<?php

$string = 'asdadad asdad Service No 0712069069 cacacggcacca asdadad asdad Service No 0716855455 cacacggcacca';

//Service No. Regex
$regex = "/Service No ([0-9]*?)/s";
preg_match_all($regex,$string,$match);

//$match[1] will now hold the data you need
print_r($match[1]);

?>

there proably will be something wrong with this as I am not a regex expert.

i got out put as

Array ( [0] => [1] => )

try this:

echo '<pre>';
print_r($match);
echo '</pre>';

tell me what you get

Array
(
[0] => Array
(
[0] => Service No
[1] => Service No
)

[1] => Array
(
[0] =>
[1] =>
)

)


im not getting mobile number thats the problem...

ok, here replace:

$regex = "/Service No ([0-9]*?)/s";

with:

$regex = "/Service No (.*?)/s";

thanks,, i did with 071/d/d/d/d/d/d


then i got read from text file also then i got out put as

[0] Service No 0712069069
[1] Service No 0716855455

like that

so now i think i can math only mobile from above out put as
[0] Service No 0712069069
0712069069
[1] Service No 0716855455
0716855455

is it posible??

i got stuck again....

s12HCharges Summary For the Mobile Service No 0712069069
(Mr. . .) of Account 1863480
_________________________________________________________________________________

Service Package Description : Corporate package for 750 CommBill No : 7810912
(s0B
&d#DCall charges &d@
Outgoing Calls - 750SP-1 25/04 - 24/05 931.00

(s3B
TOTAL CALL CHARGES ...................... 931.00
(s0B
&d#DValue added services usage &d@
Mtunes - 750SP-1 25/04 - 24/05 30.00

Outgoing SMS - 750SP-1 25/04 - 24/05 47.00

(s3B
TOTAL OF VAS ...................... 77.00
(s0B
&d#DMonthly subscriptions &d@
VPN Subscriptio - TRC 100.00

Package - 750SP-1 25/04 - 23/06 200.00

Mtunes Subscrip - TRC 50.00

(s3B
TOTAL OF SUBSCRIPTIONS ...................... 350.00
(s0B
(s3B
________________
Total Charges for the Mobile No 0712069069 1,358.00
________________

s12HCharges Summary For the Mobile Service No 0712570570
() of Account 1863480
_________________________________________________________________________________

Service Package Description : Bill No : 7810912
(s0B
&d#DCall charges &d@
Outgoing Calls - 750SP-1 09/05 - 24/05 10.00

(s3B
TOTAL CALL CHARGES ...................... 10.00
(s0B
&d#DMonthly subscriptions &d@
Package - 750SP-1 09/05 - 23/06 153.33

VPN Subscriptio - TRC 100.00

(s3B
TOTAL OF SUBSCRIPTIONS ...................... 253.33
(s0B
(s3B
________________
Total Charges for the Mobile No 0712570570 263.33


please capture as follow , i wanna insert them to my data base ... please scrit me ...
----------------------------------------
No 0712069069
Outgoing Calls 931.00
Mtunes 30.00
Outgoing SMS 47.00

No 0712570570
Outgoing Calls 10.00
---------------------------------------------

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.