En cours

Parse Text file to mysql db - simple

I need a program which will parse a file and write to a db

file to parse /var/log/asterisk/[url removed, login to view]

Every line is date and stimestamped

So we only want to parse lines which are newer than now()-10 min

db has no username or passw

all variable must be on top of script for easy editing.


| balance | varchar(8) | NO | | NULL |

| name | varchar(50) | YES | | - |

parse1_db = [url removed, login to view]

parse1_string= " balance is @b@ and"

This means if you see a string like

12-08-04 17:24:10 USB504 Top up 30 or more for a chance to match,double or triple it in bmobile's Go for Gold [url removed, login to view] account balance is 110.98 and expiry date is 2012/12/03 from ussd

mark in asterisk.trunks_trunk.balance='110.98' where name='USB504' < USB value can vary but always starts with USB and comes right after time stamp.


| Field | Type | Null | Key | Default | Extra |


| scid | varchar(25) | YES | UNI | NULL | |

| gsm_number | varchar(15) | YES | | NULL | |

| atime | timestamp | NO | | CURRENT_TIMESTAMP | |



parse2_string= "USBxxx @scid@ scid from @gsm@"

This means. If you see a string like

2012-08-04 18:43:36 USB507 12365464874654 scid from +18684642370

you do. Insert into scid_gsm values (12365464874654,+18684642370) <only if scid does not already exist in table.

Compétences : AJAX, Linux, MySQL, Perl, PHP

en voir plus : text to string, text now, string match, php script null, mysql db, match string, asterisk-perl, mysql top 10, asterisk mark, log in to your account, ussd, triple, time stamp, sms asterisk, s+db, parse, parse and, parse a string, asterisk script gsm sms, key value extra, insert variable, parse table, insert txt, perl sms script, php parse string

Concernant l'employeur :
( 88 commentaires ) dix hills, United States

Nº du projet : #2377074

5 freelance font une offre moyenne de $82 pour ce travail


I can get this done for you.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(73 Commentaires)

Hi, simple task and I can complete it very quickly. Data can be parsed using regular expression for exact matching. Thanks.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(11 Commentaires)

I'm Expert Php/MySQL and used PHP as CLI for many projects. Check your PMB for details please.

%bids___i_sum_sub_32% %project_currencyDetails_sign_sub_33% USD en 1 jour
(26 Commentaires)

I think I'm able to do it.

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(2 Commentaires)

Redy to do it

%bids___i_sum_sub_35% %project_currencyDetails_sign_sub_36% USD en 2 jours
(0 Commentaires)