Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Program
- {
- static void Main(string[] args)
- {
- int pos = 0;
- var lines = File.ReadAllText("B:/Temp/file.txt");
- //bool[] num = new bool[8];
- BitArray bits = new BitArray(new bool[8]);
- int[] number = new int[1];
- int bit = 0;
- int numcount = 0;
- while (pos != -1)
- {
- pos = lines.IndexOf("mrout" + (bit + 1).ToString() + ":=", pos + 1);
- bits.Set(bit, lines[pos + 8] == 'T');
- if (bit == 7)
- {
- bits.CopyTo(number, 0);
- var str = Convert.ToString(number[0], 2).PadLeft(8, '0');
- //Console.Write("2#" + str + ", ");
- Console.Write(number[0] + ", ");
- numcount++;
- //if ((numcount % 5) == 0) Console.WriteLine();
- }
- bit = (bit + 1) % 8;
- }
- Console.WriteLine();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment