Hi,
I wonder if someone can help me with a text parsing problem.
I have a form for a kind of an address book and I am looking for a quick method to input data into the fields.
In this form I have a memo field where I input the full details which I copy from an email msg and then I paste into this memo field.
Now from the memo field, which contains all the necessary data I have to select each item of interest (name, phone, fax, mobile, email) and then copy and paste them into the appropriate fields.
I would like, if possible, to parse the text from this memo field and extract at least the email addresses automatically and input them into the EMAIL field.
Usually there are at least 2 email addresses so the script
has to find them and put them in the fields EMAIL1 and EMAIL2. (I have provided 5 email fields. just in case)
I think this can be done with regular expressions.
Also it would be great if the script can parse also the telephone numbers and detect the country prefix and then fill in the appropriate COUNTRY field. I have in the database a COUNTRY_PREFIX field so the script can check the phone number prefix against the data from this field.
I can give you some sample data to better understand the case
------
Phone: +33 (1) 47 35 91 98
Fax: +33 (1) 47 35 92 96
email: [email protected]
-----
TEL: +972 - 9 - 8928300 FAX: + 972 - 9 - 8883643
MBL: +972 507 456741
EMail: [email protected]
------
Thanks a lot for your attention!
Regards,
Corneliu
I wonder if someone can help me with a text parsing problem.
I have a form for a kind of an address book and I am looking for a quick method to input data into the fields.
In this form I have a memo field where I input the full details which I copy from an email msg and then I paste into this memo field.
Now from the memo field, which contains all the necessary data I have to select each item of interest (name, phone, fax, mobile, email) and then copy and paste them into the appropriate fields.
I would like, if possible, to parse the text from this memo field and extract at least the email addresses automatically and input them into the EMAIL field.
Usually there are at least 2 email addresses so the script
has to find them and put them in the fields EMAIL1 and EMAIL2. (I have provided 5 email fields. just in case)
I think this can be done with regular expressions.
Also it would be great if the script can parse also the telephone numbers and detect the country prefix and then fill in the appropriate COUNTRY field. I have in the database a COUNTRY_PREFIX field so the script can check the phone number prefix against the data from this field.
I can give you some sample data to better understand the case
------
Phone: +33 (1) 47 35 91 98
Fax: +33 (1) 47 35 92 96
email: [email protected]
-----
TEL: +972 - 9 - 8928300 FAX: + 972 - 9 - 8883643
MBL: +972 507 456741
EMail: [email protected]
------
Thanks a lot for your attention!
Regards,
Corneliu
Comment