Separate and save information from a scrapbook

0

I am creating an application that reads the following information from a notebook

  

STATUS, No., DATE TIME, AMOUNT

     

Enter the floor, 11, 2/15/2018 5:21:58 PM, 1

     

It leaves floor, 11, 2/15/2018 5:26:39 PM, 1

and so already depending on the number of the gaffet but entries and exits are recorded with time and date and what I want to achieve is to compare for example see that I enter gafet 11 at 5:21:58 PM and know that it came to that hour, and what has been achieved so far is this

string[] words;
        string name = "";
        DateTime fecha;
        int counter = 0;
        string line;

        public Form1()
        {
            InitializeComponent();
            name = dtFecha.Value.Date.ToShortDateString();
            fecha = dtFecha.Value.Date;
        }

        private void dtFecha_ValueChanged(object sender, EventArgs e)
        {
            richTextBox1.Clear();
            fecha = dtFecha.Value.Date;
            name = fecha.ToString("MM/dd/yyyy");
            name = name.Replace("/","_");
            label1.Text = name;
            line = "";
            try
            {
                            // Read the file and display it line by line.  
                System.IO.StreamReader file = new System.IO.StreamReader(@"C:\Users\RNUNEZ2\Desktop\data\"+name+".txt");
            while ((line = file.ReadLine()) != null)
            {
                    counter++;
                    words = line.Split(',');
                    foreach (string word in words)
                    {

                            richTextBox1.AppendText(word.Replace(" ", "") + "\n");


                    }

            }
                file.Close();
                richTextBox1.AppendText("Cantidad de datos recividos "+counter);

            }
            catch(Exception ex)
            {
                MessageBox.Show("Error de lectura de datos por "+ ex.Message);
            }

        }

but I do not know how to separate them by input and number and then compare them with the output and number that are closest, try in the for each put some if I did not know how to solve it, so that the information of each row is saved separately to be able to compare it with the others, I just need to know how to save the data and be able to access them by the number

    
asked by R. Nuñez 02.05.2018 в 22:51
source

0 answers