<div dir="ltr">Hello<div><br></div><div>I am trying to read a file like with a series of 0s and 1s e.g.</div><div><pre style="color:rgb(8,8,8);font-family:"JetBrains Mono",monospace">111011001010<br>010011101110<br>110001001010<br>001101011101<br>110100000011<br>010110110010</pre><pre style="color:rgb(8,8,8);font-family:"JetBrains Mono",monospace"><br></pre><pre style="color:rgb(8,8,8);font-family:"JetBrains Mono",monospace">I read the file with </pre><pre style="color:rgb(8,8,8);font-family:"JetBrains Mono",monospace"><pre style="font-family:"JetBrains Mono",monospace">{ok, <span style="color:rgb(102,14,122)">Data</span>} = file:read_file(<span style="color:rgb(6,125,23)">"binary.input"</span>),</pre><pre style="font-family:"JetBrains Mono",monospace">which gives me a list of binaries and then by binary matching I get the individual numbers in binary format</pre><pre style="font-family:"JetBrains Mono",monospace">parse([<<P1:8,P2:8....>>|T])</pre><pre style="font-family:"JetBrains Mono",monospace">But now I am having the following problem</pre><pre style="font-family:"JetBrains Mono",monospace">each P? may contain 0 or 1 but in reality it contains the ascii value of the character 0 or 1</pre><pre style="font-family:"JetBrains Mono",monospace">that is 48 or 49. </pre><pre style="font-family:"JetBrains Mono",monospace">How do a get from the ascii value the actual number 0 or 1?</pre><pre style="font-family:"JetBrains Mono",monospace"><br></pre><pre style="font-family:"JetBrains Mono",monospace">Kind Regards</pre><pre style="font-family:"JetBrains Mono",monospace">Nikolas</pre></pre></div><div><br></div></div>