Mar 3, 2005, 4:31 AM
Post #2 of 2
Re: [kektex] How to append to the end of a phrase
[In reply to]
I have a list of words that I need to append a suffix to in a text file, each word separated by a newline.
For example I have a list like this one:
and I want a perl script that can read each line and append the suffix xxx for example, so I get a new txt file with:
A friend referred me to this site since I don`t know any perl.
Can anyone give me a hand?
No need for a program, just do it from the command line.
$ perl -i~ -pe 'chomp; $_ .= "xxx\n"' your_filename_here
Dave Cross, Perl Hacker, Trainer and Writer
Get more help at Perl Monks