[EMAIL PROTECTED] wrote:
>Not surprisingly, I'm still confused. Could you hold my hand?
>
>Here's what I've got --
>
>This is my table --
>
>CREATE TABLE churchmail (
> email varchar(30) NOT NULL
>);
>
>It has one field containing 40,000 email addresses.
>
>I have a text file -- remove.txt, which contains 1,500 email addresses
>which need to be removed from the churchmail table. The database is
>named midtn. I think it's the two WHERE clauses that are throwing me.
>Whatever it is, I remain stuck, and would appreciate assistance. I'd
>like to do this on the command line, no PHP.
>
>
ok, assuming you got NO spaces in the email addresses (have plain email
adresses that is).
It really doesn't matter, if you have more than one email address in a
line, but the 'for' will split the result at defined word borders (for
bash that is maybe true for ksh clones too)
for EMAIL in `cat remove.txt` ; do echo "DELETE FROM churchmail WHERE
email = '$EMAIL';" ; done | mysql midtn
that was it...pretty easy isn't it? That's why I really love Linux :-)
Greetings
Ralf
sql query
--
Ralf Narozny
SPLENDID Internet GmbH & Co KG
Skandinaviendamm 212, 24109 Kiel, Germany
fon: +49 431 660 97 0, fax: +49 431 660 97 20
mailto:[EMAIL PROTECTED], http://www.splendid.de
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php