In stream.cpp add readln, to simplify reading Windows and Linux text files #11377
Labels
Status: Blocked upstream 🛑
PR is waiting on upstream changes to be merged first
Type: Feature request
Feature request for Arduino ESP32
Uh oh!
There was an error while loading. Please reload this page.
Related area
ESP32 Reading text files and html files created in Windows or Linuxfrom LittleFS
Hardware specification
Any ESP with LittleFS
Is your feature request related to a problem?
Text files can be read using readBytesUntil with the LineFeed character but with Windows files the CR character has to be dealt with. readln would terminate on LF and ignore CR so that the user just sees c strings representing the text on each line.
Describe the solution you'd like
I have been using this code as a solution:
Describe alternatives you've considered
As mentioned earlier, text files can be read using readBytesUntil with the LineFeed character but with Windows files the CR character has to be dealt with. The advantages of readln are that:
Additional context
A quick Google search shows a number of questions in Stack Overflow, etc. requesting a solution to reading lines from text files.
I am using the function with LittleFS to read configuration key=value pairs from text files, and to read lines from html files for modification, and removal.
For me it is simple and works reliably.
I have checked existing list of Feature requests and the Contribution Guide
The text was updated successfully, but these errors were encountered: