Click here to Skip to main content
14,579,188 members
Rate this:
Please Sign up or sign in to vote.
See more:
is there any solution for below:

if suppose we are having lines as

"abcd defg"

and when we edit say "abcd" to "1234" and when clicked on button then one report should be generated in excel/csv saying below:

FIle name Line number Scanned word Edited word
1.txt 1 abcd 1234

What I have tried:

getting no idea for implementation.googled many search criteria but no result found as needed.
Updated 26-Jun-20 0:40am

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

You have the name of the source file, so reading line by line and checking for the values to change is a fairly simple matter using the StreamReader, StreamWriter* and String classes. Similarly generating the report values and writing to a .csv file is quite straightforward.

*do not try to edit the file in place if you read line by line. You could simplify it by using ReadAllLines, and then write the results at the end of the scan.
shaileshshinde 26-Jun-20 7:00am
can you please send me sample code as i am not getting idea to implement
Richard MacCutchan 26-Jun-20 8:31am
Sorry, no. This site does not provide code to order. If you had actually gone to MSDN and looked for the documentation on the classes I suggested, you would have found some sample code.
shaileshshinde 26-Jun-20 9:58am
I think website name says code of this site is for providing code only.
Richard MacCutchan 26-Jun-20 10:14am
No that is not what it says, and it is not in any way for providing code. I suggest you carefully read Code Project Quick Answers FAQ[^].

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100