473,473 Members | 2,319 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Searching for links and emails in a file containing source code

3 New Member
I am writing a program in c++ running on linux that is supposed to search for e-mails through a file of source code. The source code is already in a file.
I believe that am supposed to identify the phrase "href" and "mailto" to be able to write the necessary code to read through the whole whole file and just output the emails in another file.
How do I go about it.
Nov 19 '07 #1
5 1320
sicarie
4,677 Recognized Expert Moderator Specialist
Decide where the emails are going to be kept.
Connect to it
Get the list of emails
Open the first
Parse for the phrase you decided to look for
Nov 19 '07 #2
RedSon
5,000 Recognized Expert Expert
I am writing a program in c++ running on linux that is supposed to search for e-mails through a file of source code. The source code is already in a file.
I believe that am supposed to identify the phrase "href" and "mailto" to be able to write the necessary code to read through the whole whole file and just output the emails in another file.
How do I go about it.
are you sure that you are not supposed to identify the character expression xxx@xxx.xxx?
Nov 19 '07 #3
gakuykk
3 New Member
Decide where the emails are going to be kept.
Connect to it
Get the list of emails
Open the first
Parse for the phrase you decided to look for
Cold you elaborate more on the "get the list of emails" in code.
Nov 19 '07 #4
sicarie
4,677 Recognized Expert Moderator Specialist
Cold you elaborate more on the "get the list of emails" in code.
No. I'm not here to do your work, so I'm answering you with as much effort as it took you to post.

However, if you are willing to put effort into it - try it yourself and then post what you tried and what errors you are getting, then I (and all the Experts/Mods here) will be much more willing to help.
Nov 19 '07 #5
gakuykk
3 New Member
are you sure that you are not supposed to identify the character expression xxx@xxx.xxx?
Yes, I am supposed to identify that expression and (am assuming) use the
member function "str.find(str1,pos)" to identify the "@" symbol.
Since the "pos" is supposed to start the search at the beginning of the file, what happens when it finds the first "@" and identify the "xxx@xxx.xxx" for multiple email addresses?(Isn't the "find" function supposed to pick out the emails
and disregard everything else by identifying the beginning and end of the email?)

This is how I started that particular part
ofstream out("emails.txt");
string emails;
char search = "@";
int offset;
ifstream in("initial.txt");//file containing source code
while(!eof)
{
str.find(search, 0);//this is where am not sure about
out << search << endl;
}
Nov 22 '07 #6

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

Similar topics

5
by: simonc | last post by:
I've been programming in assembler and C/C++ for a number of years, but I'm only just starting down the road of PHP & MYSQL. I have a couple of questions: (1) Before I start writing my own...
14
by: Ludwig77 | last post by:
I read that there are some tags that can be entered in a web page's meta tags in order to prevent web bot searching and indexing of the web page for search engines. What is the tagging that I...
5
by: Alan Mackenzie | last post by:
I've recently moved onto a C++ project with a large number of directories (several hundred) containing an even larger number of C++ source files. There are vastly more ways in C++ to obfuscate a...
3
by: Paul H | last post by:
I have a text file that contains the following: ******************** __StartCustomerID_41 Name: Fred Smith Address: 57 Pew Road Croydon
33
by: Geoff Jones | last post by:
Hiya I have a DataTable containing thousands of records. Each record has a primary key field called "ID" and another field called "PRODUCT" I want to retrieve the rows that satisy the following...
12
by: Dave G | last post by:
Apologies if this has been covered before - I couldn't find it. I currently use ASPEmail to create and send HTML emails from an Access database. The text is personalised and includes embedded...
1
by: silver_animal | last post by:
Greetings, Hopefully this posting is clear to both newsgroups. I have been looking for a way to open a PDF file and automatically locate and go to a certain phrase within the file. The phrase...
8
by: Jimbo | last post by:
Hello I am currently designing an internal ordering system for IT equipment. I am designing it in ASP.NET (vb) using Visual Studio 2003 and using Microsoft SQL Server I have got the system...
3
by: Aaron | last post by:
I'm trying to parse a table on a webpage to pull down some data I need. The page is based off of information entered into a form. when you submit the data from the form it displays a...
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.