Re: Data Overload
| From: | spoon fork | Date: | Sun, 02 Jul 2000 19:49:36 +0000 |
| Subject: | Re: Data Overload | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-4391@lists.php.net to get a copy of this message | ||
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@xxxx.com
# $end_list will contain the name after xxx@xxxx.com (I assume you
# want to insert it into file;
my @user_arr = 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@xxxx.com 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);