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: emilio@xxxxxxxxxxx (Emil Slavov)
- Date: Fri, 15 Nov 2002 17:07:46 -0800
De da beshe "|" za razdelitel :). Vig faila attachnat v prednia mi posting
i nameri neshto, koeto prilicha na radelitel (probvah s niakoi kandiddat
radeliteli no stana boza). Zatova mi triabva konvertor, pisan specialno za
.dat , ne prosto da naluchkvam. Btw programki s takava baza polzvat niakoi
klonove na toplofikacia, energoto, kabelarkite i drugi ot sorta, taka che
opredeleno shte ima efekt ako se nameri neshto ...
>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
>============================================================================
============================================================================
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
============================================================================
|