linux-admin.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Help on cleaning strings
@ 2007-08-22 19:07 Mário Gamito
  2007-08-22 19:18 ` Jose Celestino
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mário Gamito @ 2007-08-22 19:07 UTC (permalink / raw)
  To: linux-admin

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,
-- 
:wq! Mário Gamito
-
To unsubscribe from this list: send the line "unsubscribe linux-admin" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help on cleaning strings
  2007-08-22 19:07 Help on cleaning strings Mário Gamito
@ 2007-08-22 19:18 ` Jose Celestino
  2007-08-23  8:05   ` terry white
  2007-08-22 19:42 ` Anup Purushu
  2007-08-22 19:51 ` Jose Celestino
  2 siblings, 1 reply; 5+ messages in thread
From: Jose Celestino @ 2007-08-22 19:18 UTC (permalink / raw)
  To: Mário Gamito; +Cc: linux-admin

Words by Mário Gamito [Wed, Aug 22, 2007 at 08:07:56PM +0100]:
>  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.

>  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

-- 
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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help on cleaning strings
  2007-08-22 19:07 Help on cleaning strings Mário Gamito
  2007-08-22 19:18 ` Jose Celestino
@ 2007-08-22 19:42 ` Anup Purushu
  2007-08-22 19:51 ` Jose Celestino
  2 siblings, 0 replies; 5+ messages in thread
From: Anup Purushu @ 2007-08-22 19:42 UTC (permalink / raw)
  To: Mário Gamito; +Cc: linux-admin

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

On Wed, 2007-08-22 at 20:07 +0100, Mário Gamito wrote:
> 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,

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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help on cleaning strings
  2007-08-22 19:07 Help on cleaning strings Mário Gamito
  2007-08-22 19:18 ` Jose Celestino
  2007-08-22 19:42 ` Anup Purushu
@ 2007-08-22 19:51 ` Jose Celestino
  2 siblings, 0 replies; 5+ messages in thread
From: Jose Celestino @ 2007-08-22 19:51 UTC (permalink / raw)
  To: Mário Gamito; +Cc: linux-admin

Words by Mário Gamito [Wed, Aug 22, 2007 at 08:07:56PM +0100]:
>  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

-- 
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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Help on cleaning strings
  2007-08-22 19:18 ` Jose Celestino
@ 2007-08-23  8:05   ` terry white
  0 siblings, 0 replies; 5+ messages in thread
From: terry white @ 2007-08-23  8:05 UTC (permalink / raw)
  To: linux-admin

: 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>


-- 
... 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 majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-08-23  8:05 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-22 19:07 Help on cleaning strings Mário Gamito
2007-08-22 19:18 ` Jose Celestino
2007-08-23  8:05   ` terry white
2007-08-22 19:42 ` Anup Purushu
2007-08-22 19:51 ` Jose Celestino

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).