Hi Gents
I have a text file that has a % symbol in it, but wlog and file.read can't see it. Is there a way around this?
Thanks
Zim
Percentage character not read from txt file
- cicciocb
- Site Admin
- Posts: 2727
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 578 times
- Been thanked: 1962 times
- Contact:
Re: Percentage character not read from txt file
What is the exact content of the file?
The % has a special meaning in html so this could be the problem
The % has a special meaning in html so this could be the problem
Re: Percentage character not read from txt file
Thanks for the quick responce!
try$ = file.read$("/data.txt",9,6)
wlog try$
or
wlog file.read$("/data.txt",9,6)
try$ = file.read$("/data.txt",9,6)
wlog try$
or
wlog file.read$("/data.txt",9,6)
You do not have the required permissions to view the files attached to this post.
- cicciocb
- Site Admin
- Posts: 2727
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 578 times
- Been thanked: 1962 times
- Contact:
- cicciocb
- Site Admin
- Posts: 2727
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 578 times
- Been thanked: 1962 times
- Contact:
Re: Percentage character not read from txt file
Use the debug window to see the content of the variable or use print
Re: Percentage character not read from txt file
print file.read$("/date.txt") --> 12345678999full (should read 123456789 99% full)
no errors in serial window
print "12 3%" --> 12 3% ( print function does show spaces and %)
no errors in serial window
print "12 3%" --> 12 3% ( print function does show spaces and %)
- cicciocb
- Site Admin
- Posts: 2727
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 578 times
- Been thanked: 1962 times
- Contact:
Re: Percentage character not read from txt file
Are you using the ESP8266?
I cannot reproduce the problem on the ESP32, i've just tried with Wokwi and WLOG "%" works
I cannot reproduce the problem on the ESP32, i've just tried with Wokwi and WLOG "%" works
You do not have the required permissions to view the files attached to this post.
Re: Percentage character not read from txt file
cicciocb
I cold booted the module (esp8266 v1.48) and the PC. Now it works as it should. errrrrrrr!
Please accept my donation for wasting your time...
Thanks
Zim
I cold booted the module (esp8266 v1.48) and the PC. Now it works as it should. errrrrrrr!
Please accept my donation for wasting your time...
Thanks
Zim
- cicciocb
- Site Admin
- Posts: 2727
- Joined: Mon Feb 03, 2020 1:15 pm
- Location: Toulouse
- Has thanked: 578 times
- Been thanked: 1962 times
- Contact:
Re: Percentage character not read from txt file
[Local Link Removed for Guests] wrote: [Local Link Removed for Guests]Wed Dec 06, 2023 5:41 pm cicciocb
I cold booted the module (esp8266 v1.48) and the PC. Now it works as it should. errrrrrrr!
Please accept my donation for wasting your time...
Thanks
Zim
![Very Happy :D](./images/smilies/icon_e_biggrin.gif)
Thanks Zim,
it was a pleasure for me
![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)