sed or script question: string replacement

From: Robert Bardos (Robert.Bardos@ZUGERKB.CH)
Date: Mon Dec 23 2002 - 06:56:59 EST


Within a control file I want to replace a long string (fully qualified file
name) with a shorter one. The short name should be padded with x'00s in
order to preserve the offset to other information in the control file. Is
there an easy way to accomplish this using either sed or shell scripts?

Example:

actual file content:
......../this_is_the_long_path_to_my/file......here_comes_the_rest

desired file content:
......./short_path_to_my/file........................here_comes_the rest

where: the dots between 'file' and 'here' must be x'00s
and where both the starting position of /path/file and 'here' are well known
(for example 20 and 100).

Any takers?

Many thanks in advance

Robert Bardos
System Engineer

CSC Switzerland AG
BU ASD Zug
Baarermatte
6340 Baar
Switzerland
Phone: +41 41 763 43 14
Fax: +41 41 763 44 45
Mobile: +41 79 256 69 74
e-Mail: rbardos@ch.csc.com
http://www.ch.csc.com <http://www.ch.csc.com>

Sicherheitsmeldung: Diese Mitteilung ist ungeschuetzt und koennte waehrend
der Uebermittlung von Dritten eingesehen und veraendert werden. Der Absender
uebernimmt deshalb fuer den Inhalt keine Haftung. Sollten Sie diese
Mitteilung irrtuemlich erhalten haben, bitten wir Sie, den Absender zu
informieren und die Mitteilung in Ihrem System zu loeschen.
Security Message: The information transmitted is unsecured and could be
reviewed or changed by an unauthorized third party. The sender therefore
does not accept any liability for its content. If you received this in
error, please contact the sender and delete the material from any computer.



This archive was generated by hypermail 2.1.7 : Wed Apr 09 2008 - 22:16:25 EDT