<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — Read Sudoku data]]></title>
		<link>https://forums.approximatrix.com/viewtopic.php?id=544</link>
		<atom:link href="https://forums.approximatrix.com/extern.php?action=feed&amp;tid=544&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Read Sudoku data.]]></description>
		<lastBuildDate>Thu, 31 Mar 2016 15:53:08 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Read Sudoku data]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=2448#p2448</link>
			<description><![CDATA[<p>And it worked for me also.<br />Thanks for the fast help.</p>]]></description>
			<author><![CDATA[null@example.com (Bob)]]></author>
			<pubDate>Thu, 31 Mar 2016 15:53:08 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=2448#p2448</guid>
		</item>
		<item>
			<title><![CDATA[Re: Read Sudoku data]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=2446#p2446</link>
			<description><![CDATA[<p>Bob,</p><p>So the text file looks something like:<br /></p><div class="codebox"><pre><code>006040089
145000070
...</code></pre></div><p>Is that correct?&nbsp; I was confused by your statement about storing the data in hexadecimal format.</p><p>Anyway, I think the issue is that the <em>Read</em> statement needs some sort of indicator that a record is complete before executing regardless of your <em>Format</em> specification.&nbsp; What you might do instead is eliminate your inner loop and read in an entire row with a proper <em>Format</em> spec that refers to 9 single-digit integers.&nbsp; The following worked for me:</p><div class="codebox"><pre><code>do i=1,9
    Read(5, &#039;(9I1)&#039;) (grid(i,j), j=1,9)
end do</code></pre></div><p>Feel free to switch back to using the explicit <em>Format</em> statement, but I thought it was simple enough to put right there in the <em>Read</em> statement.</p><p>Using that code, my array was filled with 9 single-digit integers properly.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Thu, 31 Mar 2016 12:27:58 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=2446#p2446</guid>
		</item>
		<item>
			<title><![CDATA[Read Sudoku data]]></title>
			<link>https://forums.approximatrix.com/viewtopic.php?pid=2444#p2444</link>
			<description><![CDATA[<p>I am trying to load a 9x9 sudoku grid from a text file.&nbsp; <br />The file was created in Notepad and saved as a .txt file.<br />The first row contains keyed text data 006040089 <br />and the second row contains 145000070 The data is stored <br />in Hex as <br />30 30 36 30 34 30 30 38 39 0D 0A 31 34 35 30 30 30 30 37 30 0D 0A</p><p>The following was my first unsuccessful read attempt. <br />do i=1,9<br />&nbsp; &nbsp; do j=1,9<br />&nbsp; &nbsp; &nbsp; &nbsp; Read(5,10)grid(i,j)&nbsp; <br />&nbsp; &nbsp; end do&nbsp; &nbsp;<br /> end do<br />10&nbsp; Format(I1)</p><p>All constructive advice is appreciated as I experiment.<br />Bob</p>]]></description>
			<author><![CDATA[null@example.com (Bob)]]></author>
			<pubDate>Wed, 30 Mar 2016 22:41:43 +0000</pubDate>
			<guid>https://forums.approximatrix.com/viewtopic.php?pid=2444#p2444</guid>
		</item>
	</channel>
</rss>
