Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9250617
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T10:29:07+00:00 2026-06-18T10:29:07+00:00

I have a text document with a slew of email addresses which I converted

  • 0

I have a text document with a slew of email addresses which I converted from a pdf.
here is an example of of what it looks like:

name1;someone@awebite1.com;;;
name2;someone@awebite2.com;;;
name3;someone@awebite3.com;;;
name4;someone@awebite4.com;;;
name5;someone@awebite5.com;;;

etc… 600+ contacts

anyone know to to write a simple php pattern/expression/regex I can use to separate the name and email one by one so I can put in database?

the database of course would be a simple: id | contact | email

any help would be gladly appreciated!

I forgot to mention, I would like to do it in php. I will incorporate the code into a form for future usage.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-18T10:29:08+00:00Added an answer on June 18, 2026 at 10:29 am

    In PHP, you can split a string using the explode function..

    $parts = explode(';', $inputString);
    

    The returned array contains each part separated by ;.

    For this, each line in your text document has to be given as inputString. So loop through the array returned by

    preg_split('/\\n/',$docContent)
    

    and call explode with each element. The above preg_splitreturns an array with each line of the input as an element.

    Combining both,

    $lines = preg_split('/\\n/',$docContent);
    foreach($lines as $line) {
       $parts = explode(';', $line);
       //$parts[0] is name and $parts[1] is email. ignore remaining elements
    }
    

    Note : I have only a little knowledge in php. There may be better code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the text from a PDF document available to me, and I want
I have a text document (word or pdf) which has a long list of
So I have some code here that reads from a text document and stores
I'm doing a bind to document like below, $(document).bind('click',doThis); But i have a text
I have a document structure {'text': 'here is text', 'count' : 13, 'somefield': value}
I have an HTML document where I would like to semantically group text to
I have text documents like the following which contain single and multiple variables: title::
I'm extracting some data from a text document organized like this: - day 1
I have a text document like so: <table width=10> </table> I open the document
I have a text document that looks similar to this: R.D. P.N. X Y

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.