Go Down

Topic: sending csv to serial port (Read 1 time) previous topic - next topic

Boffin1

I have a project that sends csv values from the Arduino chip, to a serial port, for the user to use the data any way they wish.

For my prototype, I send the various header titles, ( seperated by commas ) 

I hadnt thought about it, but I didnt include a CR LF to start each new line of values.

  I am using  Megunolink to monitor the data.

It displays the data perfectly, I suppose it matches the number of values to the number of column titles ?

I want to generate a csv output that any application can use, I have no idea what OS the user has.

I had a look at my prototypes output using a general Term program, the data is there but jumbled , it obviously needs a CR/LF to separate the lines of values.

What should I put at the end of each line that any spreadsheet type application will recognise in a CSV file ?

There are a few options when I have searched.

heres a snippet of the code I am sending :-

 
Code: [Select]
     {dataString += "normal" ;dataString += ","; }                                 
           dataString += String (buttonnumber) ;                 
                   dataString += ",";dataString += ",";
                   dataString += String (counter) ;dataString += ",";
                    dataString += String (clockhours );dataString += ",";
                    dataString += String (clockmins );dataString += ",";
                                  hardwired.println(dataString);

                           
                           
With my mobile phone I can call people and talk to them -  how smart can you get ?

johnwasser

The 'println()' function puts a newline ('\n') at the end of the line so I think you're covered unless your spreadsheet insists on Windows (CRLF) line endings.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Boffin1

Thanks John

I suppose the Terminal program I tried needs setting up for that..

I will let the users IT guys work it out then,  thats what they are there for :-)

With my mobile phone I can call people and talk to them -  how smart can you get ?

PaulS

Quote
I will let the users IT guys work it out then

Before you get that far, ditch the String class. Period.

Boffin1

Whats the alternative Paul  ?  , this is all new ground for me..
With my mobile phone I can call people and talk to them -  how smart can you get ?

Go Up