Prasanthi Tenneti wrote:
>
> I want to add a word at each end of the line of a file.
> my file is like this
>
> packet1.rpm
> packet2.rpm
> packet3.rpm
> packet4.rpm
>
> I want to add 'Node' word at the end of each line.
> So it should be like this
> packet1.rpm node
> packet2.rpm node
> packe
Try something like this
open IN, "/path/to/file.txt" or die "Can't find input file: $!";
open OUT, ">/path/to/ouput.txt" or die "Can't create output file: $!";
$add_this = " node";
while () {
chomp;
print OUT "$_$add_this\n";
}
close IN;
close OUT;
-Original Message-
F