Linux-Bulgaria.ORG
навигация

 

начало

пощенски списък

архив на групата

семинари ...

документи

как да ...

 

 

Предишно писмо Следващо писмо Предишно по тема Следващо по тема По Дата По тема (thread)

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
============================================================================



 

наши приятели

 

линукс за българи
http://linux-bg.org

FSA-BG
http://fsa-bg.org

OpenFest
http://openfest.org

FreeBSD BG
http://bg-freebsd.org

KDE-BG
http://kde.fsa-bg.org/

Gnome-BG
http://gnome.cult.bg/

проект OpenFMI
http://openfmi.net

NetField Forum
http://netField.ludost.net/forum/

 

 

Linux-Bulgaria.ORG

Mailing list messages are © Copyright their authors.