🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #15048

Re: Renombrar texto de un archivo

#15048
From: gradha
Date: Tue, 22 Aug 2000 00:00
35 lines
1298 bytes
Esteban <scandisk@ctv.es> wrote:

> Tengo el fichero de texto prueba, y hay

> a
> b
> c
> d
> etc...

> y quiero que haya:

> a.htm
> b.htm
> c.htm
> etc...

> �C�mo?

Con sed podr�as hacer lo siguiente:

  cat fichero | sed -e "s/\(.*\)/\1.htm/" > nuevo_fichero

Si luego quieres usar ese nuevo fichero con xargs, y tienes nombres
con espacios, entonces puede no funcionarte el xargs. S�lo har�a
falta entrecomillar el nombre del archivo:

  cat fichero | sed -e "s/\(.*\)/\"\1.htm\"/" > nuevo_fichero

Suerte.

-- 

 Grzegorz Adam Hankiewicz   gradha@iname.com - http://gradha.infierno.org
 Other web pages:  http://glub.ehu.es/  -  http://welcome.to/gogosoftware/
Technical Details
Message-ID: <bqiun8.4s2.ln@192.168.5.1>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <slrn8q5acj.8t3.scandisk@localhost.localdomain>

Show Full Headers
Complete Article Headers
X-Google-Language: SPANISH,ASCII
X-Google-Thread: f86c8,c88e1aa9ea98dc80
X-Google-Attributes: gidf86c8,public
From: gradha@iname.com
Subject: Re: Renombrar texto de un archivo
Date: 2000/08/22
Message-ID: <bqiun8.4s2.ln@192.168.5.1>
X-Deja-AN: 661258660
Content-Transfer-Encoding: 8bit
References: <slrn8q5acj.8t3.scandisk@localhost.localdomain>
Organization: Telefonica Transmision de Datos
Content-Type: text/plain; charset=ISO-8859-1
User-Agent: tin/1.4.1-19991201 ("Polish") (UNIX) (Linux/2.2.12 (i686))
Mime-Version: 1.0
Newsgroups: es.comp.os.linux.programacion