Print seperate line from a "database" in a txt file
Hi people.
I have a txt "database" where the input from my console program will be printed to.
I now want to be able to search for a specific keyword (fx a phone number), and then get it to print the entire line, the keyword is in. What is the best way to do that?
2 Replies
How does your "database" work? If you've written it, then you best know how to this
it's a text file so either
- use ReadAllLines which give you an array of every line in the file. find the index or indexes with data matching your search and output them
- stream the file line by line checking for your search term and ouput the line once found