473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Script to crawl email id from a file

<?php
//This script is written by Stalin to capture email id from a file
$fd=@fopen("email.txt","r");
if($fd)
echo "File is opened";
else
{
echo "No file is opened";
break;
}

$text=@fread($fd, filesize("email.txt")); //Read the file
$match=preg_split('/@/',$text,-1,PREG_SPLIT_OFFSET_CAPTURE); //split after @
$con = $match[0][0];
echo "<br>";
if (!$match[1][0])
echo "No mail id specified";
else {
$con1=strrev($con);
$match1=preg_split('/ /',$match[1][0],-1,PREG_SPLIT_OFFSET_CAPTURE);
echo "This is domain: ".$match1[0][0];
echo "<br>";
$match2=preg_split('/ /',$con1,-1,PREG_SPLIT_OFFSET_CAPTURE);
$name=$match2[0][0];
$revmatch=strrev($name);
//print_r($match2);
$id = $revmatch."@".$match1[0][0]; //combine the name and domain
echo "This is the email id : $id";
}
@fclose($fd);
?>


email.txt

Some sample sentences with email id within it...This php script will search any directory (and all subdirectories under that directory). It will show you the total size of the directory, number of files in the directory, and identify any files > or = to the size specified. When you run this script you will be prompted for the unix directory name and the test file size parameter. Here i give the mail of us which is somename@somedomain.com is our mail id. :)
Jul 28 '06 #1
2 2148
iam_clint
1,208 Expert 1GB
thats fantastic.. you got a question? :P
Jul 29 '06 #2
what question?? :confused: :)
Aug 1 '06 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: Martin Foster | last post by:
Hi. I would like to be able to mimic the unix tool 'uniq' within a Perl script. I have a file with entries that look like this 4 10 21 37 58 83 111 145 184 226...
1
by: Danny | last post by:
I am trying to crawl my site to get a list of links. I am using the regular expressions to get the href tags from the pages and reading the links using xmlhttp module. is there an efficient way...
11
by: Jonny | last post by:
Netscape 7.02 is giving me a headache with a downloaded snow script. Starting with a blank page, I inserted the script and checked it in IE 6 and Netscape 7.02. Everything worked and looked fine. A...
5
by: Milagro | last post by:
Hi, I'm a perl/C programmer but a Javascript problem has been dumped into my lap. A client of mine has a freeware javascript on their site which shows a series of pictures on a web page in a...
4
by: petermichaux | last post by:
Hi, I'm hoping for a reason I'm wrong or an alternate solution... I'd like to be able to dynamically include some javascript files. This is like scriptaculous.js library but their solution is...
2
by: mahesr | last post by:
Frds, how to crawl a specific word in whole website using php.need which page it has Example: want to crawl a 144 items found,on somepage.html. Pls if u have code pls mail email address...
2
by: John | last post by:
Hello everybody, I'm working on a Web site that reads a database file and diplays the contents in a datagrid my question is how can google index my page since in order to do that it needs to...
12
by: Snoopy33 | last post by:
I have a FE / BE setup on my database. One of the main reasons that I did this was so that I could edit the front end and upload it without causing problems with day to day activities. I have...
3
by: jitendrarathod | last post by:
Hello, I have a one PHP script which crawled the URLs and get the job from the URLs. My logic is so simple. First take the URL from database(total 25000 URLs). Then start to crawl the URLs....
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.