Write a program that reads a text file and inserts line numbers in front of each of its lines. The result should be written to another text file.
Read from 01_LinesIn.txt and compare your output against 01_LinesOut.txt, then read 02_LinesIn.txt and compare to its respctive output file and so on.
Examples:
Input.txt
|
Output.txt
|
Two households, both alike in dignity,
In fair Verona, where we lay our scene,
From ancient grudge break to new mutiny,
Where civil blood makes civil hands unclean.
From forth the fatal loins of these two foes
A pair of star-cross'd lovers take their life;
Whose misadventured piteous overthrows
Do with their death bury their parents' strife.
|
-
Two households, both alike in dignity,
-
In fair Verona, where we lay our scene,
-
From ancient grudge break to new mutiny,
-
Where civil blood makes civil hands unclean.
-
From forth the fatal loins of these two foes
-
A pair of star-cross'd lovers take their life;
-
Whose misadventured piteous overthrows
-
Do with their death bury their parents' strife.
|