shay Avital
Member
- Joined
- Oct 9, 2020
- Messages
- 12
- Programming Experience
- Beginner
hello,
i have a program where i read a list of values from an energy meter through a serial port. to read the buffer i use the ReadExisting() method. my problem is that the words in the second column have different length each raw so the list is not orginized well:

I am looking for a way to get it like that:

here is the code i use to read the buffer:
how can i get the input from the buffer to be aligned?
thank you,
shay.
thanks
i have a program where i read a list of values from an energy meter through a serial port. to read the buffer i use the ReadExisting() method. my problem is that the words in the second column have different length each raw so the list is not orginized well:

I am looking for a way to get it like that:

here is the code i use to read the buffer:
C#:
private void serialPort1_DataReceived_1(object sender, SerialDataReceivedEventArgs e)
{
DataIn = serialPort1.ReadExisting();
this.Invoke(new EventHandler(Showdata));
}
private void Showdata(object sender, EventArgs e)
{
textBox1.Text += DataIn;
textBox1.SelectionStart = textBox1.TextLength;
textBox1.ScrollToCaret();
}
how can i get the input from the buffer to be aligned?
thank you,
shay.
thanks
Last edited by a moderator: