|
Re: lug-bg: .dat s cyrilic(DOS) kam drug data format s cyrilic-1251
- Subject: Re: lug-bg: .dat s cyrilic(DOS) kam drug data format s cyrilic-1251
- From: raptor@xxxxxxxxxx (raptor)
- Date: Fri, 15 Nov 2002 16:03:42 -0500
ako kodirowkata ti e ok.. i .dat faila ti da rechem s "|" za razdelitel...
Nesto ot roda na :
use DBI;
$dbh = DBI->connect(....);
my $query = 'INSERT INTO table(....) VALUES ';
open FILE, "<yourfilename.dat" or die "opalanka.... : $! ";
while (<FILE>) {
my $vals;
map { $vals .= "$_, " } split /\|/, $_;
chomp $vals; chomp $vals;
$dbh->do($query.$vals) or die "hmmmm....: $! ";
};
close FILE;
hth
raptor
============================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers).
http://www.linux-bulgaria.org - Hosted by Internet Group Ltd. - Stara Zagora
To unsubscribe: http://www.linux-bulgaria.org/public/mail_list.html
============================================================================
|
|
|