ifn = input( 'input file name: ', 's' );ofn = input('output file name: ', 's' );ih = fopen( ifn, 'r' );oh = fopen( ofn, 'w' );ln = '';while ischar( ln ) ln = fgets( ih ); if ischar( ln ) fprintf( oh, ln ); endendfclose( ih );fclose( oh );
So running the script creates another .txt file of the same content as the input file. How do I change the script so it will print out the # of line it copied?
Best Answer