Serial Message manipulation

Hi,

Just a quick simple query with a stream of data I am trying to process but new to Arduino language and wish to implement as simple as possible.

I have a serial string which I am reading through on a Nano on a SoftSerial port (2 and 3). The string format is nnn,nnn.n,aaaa, where nnn is a 3 digit number, followed by another 3 digit number with a single decimal point followed by a checksum. What I need to do is send the string in to a computer (hardware serial on nano) from the device and split the stream and display the first 3 digit number as 'Distance: nnn' and 'Height, nnn.n', ignoring the checksum.
Eventually it is to be sent to a serial line printer but thats a challenge for another day.

Whats the most elegant method to do this? I have tried to hack some GPS code I saw on the internet but am having difficulty in understanding it but know I have to read the stream into a buffer and then strip out the bits I want, but am a little confused....

Thanks

For reading the string into a buffer you should find a lot of examples in the forum. Next then is to make substrings from your buffer using strtok() with the comma as the delimiter. The three smaller strings you can directly output via Serial.print() between the additional strings for the distance and height. Give it a try, use Serial.println() for printing debug information to the serial monitor. You definitely need some C and a bit of C++ understanding because Arduino is programmed in C++. And if you get stuck with your code then post it here.