FileWithLineToComment.txt
it's a text file, this one containall the lines text (not numbers of line) that we need to comment.
MyFile.txt:
Containe all the lines
MyBatchFile.bat
Is the program that i need to write. This batch file will :
1- open FileWithLineToComment.txt, and read line by line
2- for each line we read, we will search it into the "MyFile.txt"
3- one time we find it we will add " // " in the first of the find line, and like that it will be
comment.
Are these real world examples, or are they going to be text files with any amount of data, words, spaces, commas, other characters potentially on the line. Same for the list of lines to check?
Are there any blank lines etc. in the file that are important?
And just to check it seems you are checking the whole line to comment, i.e. if your string was found part way across the line.
If all of those end up being just like your answer it is a relatively simple for loop but no point writing that if not.
Are there any blank lines etc. in the file that are important?
And just to check it seems you are checking the whole line to comment, i.e. if your string was found part way across the line.
If all of those end up being just like your answer it is a relatively simple for loop but no point writing that if not.
thanks
Steve