I am currently working on saving non duplicate rows. My code is too wide to put it there, so I will just show you piece of it.
Let's say I have a textbox1 with 100 rows. If I click a button every row from textbox2 is copied to textbox1. Now textbox1 contains 120 rows of text.
What I do next is delete duplicate and empty rows from textbox1. Lets say i deleted 15 rows.
Now, my textbox1 contains 105 rows of text. And now i put another text in textbox2 and all process starts again.
That means textbox2 combined with textbox1 included 15 duplicate and 5 non-duplicate rows. I would like to show non-duplicate rows in textbox3.
Input 1
textbox1:
1
2
3
4
5
textbox2:
1
2
6
70
Output 1
textbox1:
1
2
3
4
5
6
70
textbox3:
6
70
Input 2
textbox1:
1
2
3
4
5
6
70
textbox2:
1
555
1
1
5
999
0
Output 2
textbox1:
1
2
3
4
5
6
70
555
999
0
textbox3:
6
70
555
999
0
My code to delete duplicate and blank lines:
textBox1.Text += "\r\n";
textBox1.Text += textBox2.Text;
textBox1.Text = Regex.Replace(textBox1.Text, @"^\s*$(\n|\r|\r\n)", "", RegexOptions.Multiline);
textBox1.Text = string.Join(Environment.NewLine, textBox1.Lines.Distinct());
I am adding a newline to textbox1, because without that first line of textbox2 is being added at the end of last line of textbox2.
Im stuck with exporting nonduplicates rows and I decided to ask there.