arduino / arduino/Arduino

Arduino SD class / File class: feature request: readln() missing (... and more...)

Open
#11,635 2 comments 0 reactions 0 assignees View on GitHub
Component: Core feature request
Dominant language
Java
Stars
14.6k
Forks
7k
PR merge metrics
No merged PRs in 30d

Description

a method
.readStringUntil(EOL) or perhaps a new .readln()
is missing: to read an entire textline all at once until end of line, discarding any EoL/LF/CR
(e.g., text files on an SD may have \n or \r\n at EoL, so readStringUntil('\n') or readStringUntil('\r') may fail or mess it up)

edit, perhaps sth like my workaround
```
File SD_File;
String buf;
buf = SD_File.readStringUntil('\n');
int blen=buf.length();
if( blen>=1 && buf[blen-1]=='\r' ) buf.remove(blen-1, 1);
```

Contributor guide

Open the contributing guide

Research direction

Start from the Arduino SD/File class and the SD_File.readStringUntil('\n') workaround described in the issue. Check how line endings are currently handled for LF and CRLF, then verify that the proposed readln-style behavior reads one complete line and discards either ending form.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
embedded-iot
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.