Shop OBEX P1 Docs P2 Docs Learn Events
How to create a new line using SDRW when saving to SD card? — Parallax Forums

How to create a new line using SDRW when saving to SD card?

LimahongLimahong Posts: 3
edited 2012-05-21 14:55 in Announcements
I'm trying to save data and make a new line for each new data string into my SD card using the SDRW obx program. I tried using the command
sdfat.pputc(13)
to make a new line but a new line does not appear on the saved data set in my SD card and my saved date appears as a looooong string. Does anyone know what command i should use to obtain a new line or carriage return?
Thank you.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2012-05-16 14:47
    You also need a newline character (10).

    The newline character should come after the carriage return(13 10).

    If you use a .txt as the file type and import the file to Excel, you'll see new lines with just the carriage return (13).

    With Kye's SD driver I use this to end a line.
    Sd.writeByte(13)
      Sd.writeByte(10)
    
  • LimahongLimahong Posts: 3
    edited 2012-05-21 14:55
    Thanks, Duane. I still used the SDRW obx program. When I the saved file in notepad, the data appears as a long line of characters. However, when I open the file in excel, the data did move to the next line. Thank you.
Sign In or Register to comment.