Making serial data readable for Excel

Hello All,

I am getting some data in from a 3rd party sensor. I receive one packed of data every second for ~4 hours and write it to my SD card shield. The data is formatted as follows:

PTU: 1006.23, 21.61, 41.09 STAT: 5.0, 26.0 GPSX: 0.00000, 0.00000, 0.0, 00, 0.000, 0.000, 0.000, 00:00:00

The carriage returns in the data are giving me fits in terms of making the data easy to read/plot in excel. Can you think of a simple way to remove the carriage returns in the data? I would prefer not to just "ignore" every Nth byte that comes in, because sometimes the number of significant figures in the data changes.

A Perl script?

Can you think of a simple way to remove the carriage returns in the data?

Just don't write them to the SD card.

On the other hand, every csv file I've ever created had carriage returns and line feeds, and excel has no trouble importing the files.

So, why are you having trouble? What kind of trouble are you having?

The trouble I am having is that I want only one Excel row of data for every three rows of data that are coming out of the sensor. I could use comma and space - delimited separation to achieve separation of the data if I could only take care of the fact that one row of data is currently cut up into three rows.

In that case read (and buffer) the three rows, once you have got all three rows write out the parts you want in the format you want. You would want to recognise the \n characters to detect where the lines started/ended and the first few characters of each line to detect which line it is. Since you're trying to produce CSV and the text you're getting is CSV with a prefix, you could probably just strip everything before the ':' and strip every newline character, concatenate the three lines in the required order and append a newline.