On Wed, Dec 18, 2002 at 01:29:59PM +0200, Malik Bülent wrote: > I have a file. > How can I backspace 5 character that start with expressions(the expression > starts /aaa) in a file ? > for example my file; > " /aaa/yy/ > /aaa/.. > "
If you mean "how can I delete each instance of 5 characters starting with /aaa from a file", then something like this should do it: perl -pi.bak -e 's:/aaa.::g;' filename which deletes the /aaa and the following (fifth) character. If you mean to delete the 5 characters immediately *following* /aaa then: perl -pi.bak -e 's:(?<=/aaa).{5}::g' filename Cheers, Matthew -- Dr Matthew J Seaman MA, D.Phil. 26 The Paddocks Savill Way Marlow Tel: +44 1628 476614 Bucks., SL7 1TH UK To Unsubscribe: send mail to [EMAIL PROTECTED] with "unsubscribe freebsd-questions" in the body of the message