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
|