Skip to contentSkip to conversation

Help on cleaning strings

DISCUSSION Mário Gamito 4 participants 5 messages Aug 22, 2007 – Aug 23, 2007

lore
Share & tools
lore
#0 lore raw

Hi,

Sorry for the newbie question, but I've searche over the web and couldn' find an answer to what I need.

I need to clean all the ocorrences of the "##Z/" string (without the quotes), from a series of .html files located in a single directory.

Can someone help me, please ?

Any help would be appreciated.

Warm Regards,

Signature · 5 lines
:wq! Mário Gamito
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#1 lore raw

Words by Mário Gamito [Wed, Aug 22, 2007 at 08:07:56PM +0100]:

Quoted 4 lines

Hi,

Sorry for the newbie question, but I've searche over the web and couldn' find an answer to what I need.

Not nearly hard enough.

Quoted 4 lines

I need to clean all the ocorrences of the "##Z/" string (without the quotes), from a series of .html files located in a single directory.

Can someone help me, please ?

Yes.

cd dir
for i in *.html;do vi +%s,##Z/,,g +x $i; done

Signature · 10 lines
Jose Celestino
----------------------------------------------------------------
http://www.msversus.org/     ; http://techp.org/petition/show/1
http://www.vinc17.org/noswpat.en.html
----------------------------------------------------------------
"And on the trillionth day, Man created Gods." -- Thomas D. Pate
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw

: Mário Gamito [Wed, Aug 22, 2007 at 08:07:56PM +0100]:

: Sorry for the newbie question

why. if nothing else, that the reason for this list.

the following script should work ...

<NEXT LINE STARTS CODE>
#!/bin/sh

# create vanilla list of *.html to process
for F in dir -1 --color=never *.html ;

# make backup
do mv $F $F.save

# pipe it into the string editor

     cat $F.save | sed s/\#\#Z\//  > $F ;

done
exit
<PREVIOUS LINE ENDS CODE>

Signature · 7 lines
... i'm a man, but i can change,
    if i have to , i guess ...

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#3 lore raw
In reply to Mário Gamito

perl -p -i.bak -e 's{##Z\/}{}g' *.html

Quoted 5 lines · Mário Gamito

Hi,

Sorry for the newbie question, but I've searche over the web and couldn' find an answer to what I need.

Quoted 8 lines

I need to clean all the ocorrences of the "##Z/" string (without the quotes), from a series of .html files located in a single directory.

Can someone help me, please ?

Any help would be appreciated.

Warm Regards,

-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
In reply to Mário Gamito

Words by Mário Gamito [Wed, Aug 22, 2007 at 08:07:56PM +0100]:

Quoted 10 lines

Hi,

Sorry for the newbie question, but I've searche over the web and couldn' find an answer to what I need.

I need to clean all the ocorrences of the "##Z/" string (without the quotes), from a series of .html files located in a single directory.

Can someone help me, please ?

Any help would be appreciated.

sed -i.bak -e 's,##Z/,,g' *.html

Signature · 10 lines
Jose Celestino
----------------------------------------------------------------
http://www.msversus.org/     ; http://techp.org/petition/show/1
http://www.vinc17.org/noswpat.en.html
----------------------------------------------------------------
"And on the trillionth day, Man created Gods." -- Thomas D. Pate
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html