Click here to Skip to main content
15,898,371 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
I have tried many times but i was unable to do parsing?Could you please help me to come out from this problem.

What I have tried:

static void Main(string[] args)
       {


           foreach (string line in File.ReadLines("Parsing.txt"))
           {
               Console.WriteLine("{0}", line);

           }
           Console.Write("Input your search text: ");
           var text = Console.ReadLine();

       }
Posted
Updated 19-Nov-18 1:51am
Comments
Aydin Homay 19-Nov-18 6:10am    
Are you trying to load a file in C++ and search for a word on it?
Richard MacCutchan 19-Nov-18 7:10am    
What do you mean by parsing? What is the structure of the text in the file, and what information are you trying to extract?

1 solution

You need to check the format of your file. Maybe you start reading it into a char array to see whether some invisible control characters lile '\r" are in the file. Replace them or filter them out.

Maybe you havent opened the file because it wasnt found. Best is to use a full path (or relative to the app).

Learn to use the debugger.
 
Share this answer
 

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900