<p>It looks like you have found a bug in the file block. I am guessing that the text after the first line must have the a hidden newline character or something like that that causes it to not the switch block values.</p>

<p>However, I was able to get it working with numeric values. </p>

<p>Sample <code>data.rtf</code></p>

<pre><code>1
2
3
4
5
</code></pre>

<p>Sample code: 
<a href="https://i.sstatic.net/8wjP7.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8wjP7.png" alt="EV3-G screenshot"></a></p>

<p>I also noticed that it doesn't work unless the file has Windows line endings (CRLF). If you are using Notepad in Windows, this is not a problem.</p>

CC BY-SA 3.0
2017-07-30T07:35:23.977Z
thanks a lot for this David - i guess i will switch to numeric as my list of inputs although think i tried that before and it gave me same problem.  Did you use usual windows notepad editor to create your data.rtf?
user9030
CC BY-SA 3.0
2017-07-30T18:35:18.680Z
I tested on macOS using Visual Studio Code for my text editor. It allows you to select which type of line endings to use in the file.
David Lechner
CC BY-SA 3.0
2017-07-30T03:34:26.817Z
2017-07-30T03:34:26.817Z
David Lechner
<p>i am using file access to input variables into my programm.
text file is something like this:
a
b
c
..</p>

<p>on each loop, program access file (using File Access block) and reads a new line "a" or "b" or "c" etc. and write this into a variable. I then use this variable as input for switch block. However switch block only recognized the very first character, while all others are very much all "false"</p>

<p>i know file access pulls out the information (i can display such input using the display block to show it..) yet for the switch block this information does not get recognized.</p>

<p>i tried with numeric, but i get the same problem..</p>

<p>Any ideas?</p>

<p>thanks!</p>

<p><a href="https://i.sstatic.net/lCf1A.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/lCf1A.jpg" alt="input text file"></a></p>

<p><a href="https://i.sstatic.net/HnK8M.jpg" rel="nofollow noreferrer"><img src="https://i.sstatic.net/HnK8M.jpg" alt="code - file access read input from txt file into a variable that is then used to display it on the screen one character at a time. switch is used to change size.&quot;B&quot; should be bigger variables are displayed but condition of the switch is always &quot;false&quot;"></a></p>

CC BY-SA 3.0
2017-07-28T14:34:53.103Z
Welcome. Please update your post with a clear image of your code, or at least the relevant section(s)
Phil B.
<ev3><mindstorms>
EV3 switch block does not recognize text?
user9030
# EV3 switch block does not recognize text?

(Asked by: username_0 on 2017-07-28)

i am using file access to input variables into my programm.
text file is something like this:
a
b
c
..

on each loop, program access file (using File Access block) and reads a new line "a" or "b" or "c" etc. and write this into a variable. I then use this variable as input for switch block. However switch block only recognized the very first character, while all others are very much all "false"

i know file access pulls out the information (i can display such input using the display block to show it..) yet for the switch block this information does not get recognized.

i tried with numeric, but i get the same problem..

Any ideas?

thanks!

[![input text file](https://i.sstatic.net/lCf1A.jpg)](https://i.sstatic.net/lCf1A.jpg)

[![code - file access read input from txt file into a variable that is then used to display it on the screen one character at a time. switch is used to change size.](https://i.sstatic.net/HnK8M.jpg)](https://i.sstatic.net/HnK8M.jpg)

**Tags:** ev3, mindstorms

> **Comments:**
> **username_1**: Welcome. Please update your post with a clear image of your code, or at least the relevant section(s)  

---

## 1 answers

### Answer by username_2 on 2017-07-30. Score: 1

It looks like you have found a bug in the file block. I am guessing that the text after the first line must have the a hidden newline character or something like that that causes it to not the switch block values.
However, I was able to get it working with numeric values. 
Sample data.rtf
1
2
3
4
5

Sample code: 

I also noticed that it doesn't work unless the file has Windows line endings (CRLF). If you are using Notepad in Windows, this is not a problem.

> **Comments:**
> **username_0**: thanks a lot for this David - i guess i will switch to numeric as my list of inputs although think i tried that before and it gave me same problem.  Did you use usual windows notepad editor to create your data.rtf?  
> **username_2**: I tested on macOS using Visual Studio Code for my text editor. It allows you to select which type of line endings to use in the file.  

---

