Advertisement
Guest User

Untitled

a guest
Nov 12th, 2019
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.94 KB | None | 0 0
  1. static class InOut
  2. {
  3. //------------------------------------------------------------
  4.     /** Skaito, analizuoja ir rašo į skirtingus failus.
  5.     @param fv - duomenų failo vardas
  6.     @param fvr - rezultatų failo vardas
  7.     @param fa - analizės failo vardas */
  8.     public static void Apdoroti(string fv, string fvr, string fa)
  9.     {
  10.         string[] lines = File.ReadAllLines(fv, Encoding.UTF8);
  11.         using (var fr = File.CreateText(fvr))
  12.         {
  13.             using (var far = /* As esu gudrutis */ File.CreateText(fa))
  14.             {
  15.                 foreach (string line in lines)
  16.                 {
  17.                     if (line.Length > 0)
  18.                     {
  19.                         string nauja = line;
  20.                         if (TaskUtils.BeKomentaru(line, out nauja))
  21.                             far.WriteLine(line);
  22.                         if (nauja.Length > 0)
  23.                             fr.WriteLine(nauja);
  24.                     }
  25.                     else
  26.                         fr.WriteLine(line);
  27.                 }
  28.             }
  29.         }
  30.     }
  31. //------------------------------------------------------------
  32.  
  33. static class InOut
  34. {
  35.     public static void Apdoroti(string fv, string fvr, string fa)
  36.     {
  37.         string[] lines = File.ReadAllLines(fv, Encoding.UTF8);
  38.         using (var fr = File.CreateText(fvr))
  39.         {
  40.             using (var far = / File.CreateText(fa))
  41.             {
  42.                 foreach (string line in lines)
  43.                 {
  44.                     if (line.Length > 0)
  45.                     {
  46.                         string nauja = line;
  47.                         if (TaskUtils.BeKomentaru(line, out nauja))
  48.                             far.WriteLine(line);
  49.                         if (nauja.Length > 0)
  50.                             fr.WriteLine(nauja);
  51.                     }
  52.                     else
  53.                         fr.WriteLine(line);
  54.                 }
  55.             }
  56.         }
  57.     }
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement