php-general | 2000071
Date: 07/02/00
- Next message: Jonas Jochum: "Re: [PHP] Data Overload"
- Previous message: Masood Nasir: "Re: [PHP] include and require"
- In reply to: Nick Catalano: "[PHP] Data Overload"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Hi,
I don't have PHP handy (still learning ;-)), but this is a quick,
elementary hack that might be of use. It's perl, my language of choice.
Good luck
--mel
=====
System Administrator, Techno Poet, MyWeb Inc.com
http://www.myweb.com.my/~meling
#!/usr/bin/perl -w
use strict;
my $file="users.txt";
open (LUSERS, "<$file") or die $!;
while (my $line = <LUSERS>) {
# split the file
# $dom_list will contain xxx <email protected>
# $end_list will contain the name after xxx <email protected> (I assume you
# want to insert it into file;
my <email protected> = split(/\s+/,$line);
my $dom_list = $user_arr[0];
my $end_list = $user_arr[1];
# use chomp is you want the data in one line inside the file
# split xxx <email protected> so that we can create files named
# xxxx.com, and insert xxxx into it
my ($user, $domain) = (split(/\@/,$dom_list))[0,1];
system("touch $domain");
system("echo $user >> $domain");
system("echo $end_list >> $domain");
}
close(LUSERS);
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe <email protected> For additional commands, e-mail: php-general-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Jonas Jochum: "Re: [PHP] Data Overload"
- Previous message: Masood Nasir: "Re: [PHP] include and require"
- In reply to: Nick Catalano: "[PHP] Data Overload"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

