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

 

начало

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

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

семинари ...

документи

как да ...

 

 

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

RE: lug-bg: vapros za filter


  • Subject: RE: lug-bg: vapros za filter
  • From: stefand@xxxxxxxxxxxxxx (Stefan Dragnev)
  • Date: Sun, 24 Sep 2000 11:34:28 -0400



Zdravej,

Predpolagam che filtera, koito ti triabva
moge da se napishe i na awk, no ponege awk e line
orientiran shte imash problemi s komentari koito pochhvat
na edin red i svarshvat na drug red. (Ne sam spec po awk
taka che priemi tvardenieto mi s rezervi)

Programkata po dolu iziskva perl no predpolagam che
shtom si na Linux go imash instaliran. Zameni parvia
red s pathia kam tvoia perl i krasti fila filter_comment.pl
Sled tova ia startiraj taka:

filter_comment.pl   ime_na_fila_s_comentari    ime_na_fila_bez_komentari

Ako ne dadesh vtori parametar filtrirania file se zapisva v file
filtered.txt v
tekushta direktoria kadeto si pusnal programata.

#!/usr/bin/perl5

use strict;

exit unless $ARGV[0]; # lipsva fila koito shte se filtrira
$/ = undef;
my ($file) = <>;
my $output;

$file =~ s|\[                # matchva otvariashta kvadratna skoba
               [^\[\]]*?       # matchva naj kasata posledovatelnost ot
simvoli koito ne sa kvadratni skobi
              \]                # matchva zatvariashta kvadratna skoba
              ||gx;            # zamenia s nishto namerenia komentar

$output = $ARGV[1] || "filtered.txt";
open(FILE, ">$output") || die "Cannot open the otput file";
print FILE $file;
close FILE;

Uspehi s konvertiraneto i ako imash problemi s programkata
pitaj.

Stefan

> -----Original Message-----
> From: owner-lug-bg@xxxxxxxxxxxxxxxxxx
> [mailto:owner-lug-bg@xxxxxxxxxxxxxxxxxx]On Behalf Of roska@xxxxxxxxxxxx
> Sent: Sunday, September 24, 2000 6:41 AM
> To: lug-bg@xxxxxxxxxxxxxxxxxx
> Subject: lug-bg: vapros za filter
>
>
> Zdraveite.  Imam edin vapros svarzan sas filtrirane na text. Triabva mi da
> otseia ot edin tekstov file (okolo 250k) izrazite, namirasti se mezdu
> [kwadratni] skobi - t.e. komentarite. Posle smiatam da go otpechatam -
> smiatam che ste si spestia pone napolowina parite za pechat. Ne
> sam mnogo v
> chas s filtrite - polzwam malko grep , ama za gawk i sed samo sam chel,
> taka che vsiaka pomost po vaprosa bi mi bila ot polza. Kak da naprawya
> filtriraneto?
>
> 10x predvaritelno
> ==================================================================
> 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.