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

 

начало

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

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

семинари ...

документи

как да ...

 

 

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

Re: lug-bg: Perl wizards


  • Subject: Re: lug-bg: Perl wizards
  • From: stefand@xxxxxxxxxxxxxx (Stefan Dragnev)
  • Date: Tue, 24 Oct 2000 09:41:10 -0400 (EDT)



Savsem lesno e. 
Polzvat se hashove v perl

Ne sam puskal programkata no ne bi tribval da ima problemi.
Ako neshto ne varvi pishi mi.
Moge da se napishe i kato one-liner no spored men
dolnia kod e po iasen.

#!/usr/bin/perl5

use strict;

my %dupl_hash;

# izpolzvaj razlichni imena za dvata fila
open( INFILE, "path_to_orig_file") || die;
open( FILTFILE "path_to_filt_file") || die;

while (<INFILE>) {
   $dupl_hash{$_} = 1; # edinicata ne se izpolzva. Reda ot fila 
                       # se zapazva kato key v hasha
} 
close INFILE;

foreach ( key %dupl_hash ) {
  print FILTFILE $_;
}
close FILTFILE;

Stefan

On Tue, 24 Oct 2000, Peter Georgiev wrote:

> Hiya all,
> 
> Znachi imam textov file s okolo 200000 zapisa,
> kato vseki zapis e na otdelen red.
> 
> Iskam da izchistia tezi zapisi, koito se dublirat.
> 
> Niakoi mozhe li da drasne edno redche na Perl, che hich me niama...
> 
> TKS in ADV
> Pesho
> ==================================================================
> A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
> Otpiswaneto RABOTI !!! : Majordomo@xxxxxxxxxxxxxxxxxx UNSUBSCRIBE LUG-BG
> http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora
> 

==================================================================
A mail-list of Linux Users Group - Bulgaria (bulgarian linuxers)
Otpiswaneto RABOTI !!! : Majordomo@xxxxxxxxxxxxxxxxxx UNSUBSCRIBE LUG-BG
http://www.linux-bulgaria.org/ Hosted by Internet Group Ltd. - Stara Zagora


  • Относно:

 

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

 

линукс за българи
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.