Re: how to manipulate word using perl
[email protected] ("John W. Krahn")
| Newsgroups | perl.beginners |
|---|---|
| Message-ID | <[email protected]> |
Rajnikant wrote: > >> From: Gowri Chandra Sekhar Barla, TLS, Chennai [mailto:[email protected]] >> >> I facing a problem to substitute extensions of file with " = " >> >> >> For example: >> >> In a file I have names of some files >> >> a.txt >> b.txt >> c.txt >> >> I want them to >> >> a= >> b= >> c= > > Try this: > perl -pli -e 's/.txt/=/' input_file ITYM: perl -pi -e 's/\.txt$/=/' input_file John -- Perl isn't a toolbox, but a small machine shop where you can special-order certain sorts of tools at low cost and in short order. -- Larry Wall