Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. class Program
  2. {
  3. static void Main(string[] args)
  4. {
  5. ReadFile().Wait();
  6.  
  7. Console.ReadLine();
  8. }
  9.  
  10. static async Task ReadFile()
  11. {
  12. using (StreamReader sr = new StreamReader("upload.sql"))
  13. {
  14. string line;
  15. while ((line = await sr.ReadLineAsync()) != null)
  16. {
  17. int index = -1;
  18. if(!string.IsNullOrEmpty(line) && (index = line.IndexOf("q2_")) != -1)
  19. {
  20. var splited = line.Substring(index, line.IndexOf(' ', index) - index);
  21. Console.WriteLine(splited);
  22. }
  23. }
  24. }
  25. }
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement