?
Solved

Deleting selected email address from a txt file?

Posted on 1998-09-14
6
Medium Priority
?
162 Views
Last Modified: 2010-03-05
I have a sign up form that writes the users email address to a txt file and I would like to include an admin interface so that I can pick and choose email addresses that should or need to be removed from the txt file.
0
Comment
Question by:rgoniea
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
6 Comments
 

Author Comment

by:rgoniea
ID: 1204847
Edited text of question
0
 
LVL 5

Expert Comment

by:b2pi
ID: 1204848
Is there a question here?
0
 

Author Comment

by:rgoniea
ID: 1204849
Yes it is right there, I want to add an admin section to my script to remove old or unwanted email addresses from the text file that stores the email addresses. How is this accomplished??
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 4

Expert Comment

by:martinag
ID: 1204850
Well, I might give you some hints.

* First, you've got to have a password... Use encrypt.
  Either it will be entered once and then the admin-page is shown OR it is to be entered at the admin-page when a change is made.

* Listing of addresses.
  You can add them to a <SELECT> tag in the admin-page on the fly OR every time an address is added/changed/deleted.

* Delete addresses
  The selected address is removed from emails.txt or whatever file you are using.
  $file =~ s/$remove\n//;

Such script(s) shouldn't be too difficult.

Martin
0
 
LVL 1

Accepted Solution

by:
stormerider earned 140 total points
ID: 1204851
Or also do something like this:

foreach $email (@arrayofemails) {
   print "<INPUT TYPE=CHECKBOX VALUE="$email">$email<BR>\n";
}

And then in the CGI that would remove them, you take the ones that are passed to the CGI because they are checked and s///g them. If you have an email address I can also mail you a way to do it via TEXTAREA tags if it isn't a 30K+ file (Browser limitations in displaying TEXTAREAS).
0
 

Author Comment

by:rgoniea
ID: 1204852
Stormrider, I am very new to writing Perl programs, could you explain with further code. What would be the process for opening the txt file and listing the email addresses and then deleting the ones I wanted too?
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
In the distant past (last year) I hacked together a little toy that would allow a couple of Manager types to query, preview, and extract data from a number of MongoDB instances, to their tool of choice: Excel (http://dilbert.com/strips/comic/2007-08…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
Six Sigma Control Plans

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question