Interviews Questions, Algorithms, Aptitude, C Interview Program, C Theory Question, Aptitude Tricks, Test Series,

Sunday 28 April 2019

IOPP Program No.6.B

Program No.6.B 

 Write a Perl script to copy the contents of one file to another file.

Solution:

open(file1,"<source.txt");
open(file2,">destination.txt");
open(file3,">>appendfile.txt");

while(<file1>)
{
        print file2 $_;
print $_;
        print file3 $_;

}

0 comments:

Post a Comment