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

 

начало

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

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

семинари ...

документи

как да ...

 

 

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

Re: lug-bg: search and replace


  • Subject: Re: lug-bg: search and replace
  • From: danchev@email.domain.hidden (George Danchev)
  • Date: Thu, 6 Mar 2003 07:46:00 +0200


On 06 03 2003 00:18, Peter An. Zyumbilev wrote:
<em class="quotelev1">> Zdraveite,
<em class="quotelev1">> ima li niakakav tool koito da tarsi vav vsichi filove v opredela direktoria
<em class="quotelev1">> i v neinite subdirektorii za opredel text "text1" i da go ZAMESTVA s
<em class="quotelev1">> "text2". Pod windows tova go pravi s  Macromedia homesite ..problema e pod
<em class="quotelev1">> debian server-a(no X) kak da go pravia ?Ako beshe prosto search s grep
<em class="quotelev1">> iasno...
<em class="quotelev1">> Po princip vijdam kak ste sten na perl am triabva da ima nesto gotovo
<em class="quotelev1">> ......vse pak toplata voda......

man sed.

ex: target ot Makefile-a na book-ovete ;-) dirs html's na koito trebe se 
smenqt vsi4ki "oldstring" s "newstring":

htmlsplit/$(TEXFILE).html: $(SOURCES)
        -mkdir htmlsplit
        latex2html \
                -html_version 4.0 \
                -scalable_fonts \
                -local_icons \
                -iso_language BG \
                -dir htmlsplit \
                -no_auto_navigation \
                -split 4 \
                $(TEXFILE).tex
        for i in htmlsplit/*.html; do \
        cat "$$i" | sed \
        -e "s/charset=iso-8859-1/charset=windows-1251/"  > "$$i.new" \
        -e 's/Next/Íàïðåä/g' \
        -e 's/Previous/Íàçàä/g' \
        -e 's/Contents/Ñúäúðæàíèå/g' ; \
        mv "$$i".new "$$i" ; \
        done ; \
        echo "BODY { background-color: white; margin: 4em }" >> 
htmlsplit/$(TEXFILE).css ; \
        echo "IMG { margin: 1em }" >> htmlsplit/$(TEXFILE).css
        cp -r images htmlsplit

Ako ne go vikash ot Makefile a otsamostoqtelen shell script samo mahash \ v 
kraq na redovete. Razbira se s Perl parse, search/extract and replace mozhe 
da e oste po-gyvkavo ... eto ti oste dna utilka:
http://danchev.fccf.net/files/axe za parse and extract, kato mozhesh d 
dopishesh replace 4astta pak na perl ili v otdelen shell/perl/python script.

btw kakvo e Macromedia ?


-- 
printk("Greets, fr33zb1\n");
============================================================================
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.