It needs to read string data from a file, find the same string within that file multiple times and creates a newline after each occurrence. Also from the begging of the file, numbers the lines sequentially from 1 to ? till end of file.
First you need to read in the search text from the console - for example 2015.
The you start to read the file line by line. If the line contains 2015 replace with 2015\n and write it to the output file. If not write the original line to the output.