<?xml version="1.0" encoding="UTF-8"?>
	<rss version="2.0"
		xmlns:content="http://purl.org/rss/1.0/modules/content/"
		xmlns:wfw="http://wellformedweb.org/CommentAPI/"
		xmlns:dc="http://purl.org/dc/elements/1.1/"
		xmlns:atom="http://www.w3.org/2005/Atom"

			>

	<channel>
		<title>Cycling 74  &#187;  Topic: outputting one line of a text file per bang</title>
		<atom:link href="http://cycling74.com/forums/topic/outputting-one-line-of-a-text-file-per-bang/feed" rel="self" type="application/rss+xml" />
		<link>http://cycling74.com/forums/topic/outputting-one-line-of-a-text-file-per-bang/feed</link>
		<description></description>
		<pubDate>Wed, 19 Jun 2013 00:22:14 +0000</pubDate>
		<generator>http://bbpress.org/?v=2.2.4</generator>
		<language></language>

		
														
					
				<item>
					<guid>http://cycling74.com/forums/topic/outputting-one-line-of-a-text-file-per-bang/#post-54641</guid>
					<title><![CDATA[outputting one line of a text file per bang]]></title>
					<link>http://cycling74.com/forums/topic/outputting-one-line-of-a-text-file-per-bang/#post-54641</link>
					<pubDate>Thu, 27 Jan 2011 23:22:32 +0000</pubDate>
					<dc:creator>evanlivingston</dc:creator>

					<description>
						<![CDATA[
						<p>I&#8217;m trying to build a java external ( and learn java ) which processes a text file and only outputs one line per bang. The problem is I know very little about java and all the tutorials only demonstrate how to load /display an entire file in java.</p>
<p>Can anyone point me in a good direction?</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/outputting-one-line-of-a-text-file-per-bang/#post-196820</guid>
					<title><![CDATA[Re: outputting one line of a text file per bang]]></title>
					<link>http://cycling74.com/forums/topic/outputting-one-line-of-a-text-file-per-bang/#post-196820</link>
					<pubDate>Fri, 28 Jan 2011 10:18:28 +0000</pubDate>
					<dc:creator>volker böhm</dc:creator>

					<description>
						<![CDATA[
						<p>you should check out &#8220;FileReader&#8221; (for reading text/characters) and &#8220;BufferedReader&#8221;.<br />
the latter has a readLine() method.</p>
<p>post what you have, so people can see, where you&#8217;re stuck.</p>
<p>a search for &#8220;java FileReader examples&#8221; or similar, will provide you with some useful example code.</p>
<p>vb</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/outputting-one-line-of-a-text-file-per-bang/#post-196821</guid>
					<title><![CDATA[Re: outputting one line of a text file per bang]]></title>
					<link>http://cycling74.com/forums/topic/outputting-one-line-of-a-text-file-per-bang/#post-196821</link>
					<pubDate>Sat, 29 Jan 2011 02:50:31 +0000</pubDate>
					<dc:creator>evanlivingston</dc:creator>

					<description>
						<![CDATA[
						<p>Right now I&#8217;ve got;</p>
<p>import java.io.BufferedReader;<br />
import java.io.FileReader;<br />
import java.io.IOException;</p>
<p>public class Reader {</p>
<p>	void readLine(String fileName)<br />
{<br />
		java.io.BufferedReader br = null;<br />
		try {<br />
			BufferedReader in = new BufferedReader(new FileReader(&#8220;/users/evanlivingston/Desktop/Text.txt&#8221;));<br />
			String str;<br />
			while ((str = in.readLine()) != null) {<br />
				System.out.print(str);<br />
			}<br />
			in.close();<br />
		} catch (IOException e) {<br />
		}<br />
	}<br />
}</p>
<p>This displays a text file in Terminal, though it displays the entire contents of this. My knowledge of java is terribly weak and I don&#8217;t know how to direct is to print one specific line of text.</p>
						]]>
					</description>

					
					
				</item>

			
				<item>
					<guid>http://cycling74.com/forums/topic/outputting-one-line-of-a-text-file-per-bang/#post-196822</guid>
					<title><![CDATA[Re: outputting one line of a text file per bang]]></title>
					<link>http://cycling74.com/forums/topic/outputting-one-line-of-a-text-file-per-bang/#post-196822</link>
					<pubDate>Sat, 29 Jan 2011 09:08:43 +0000</pubDate>
					<dc:creator>volker böhm</dc:creator>

					<description>
						<![CDATA[
						<p>ok, first thing you need to do to bring this into max is to add max.jar to the classpath and in your code to properly extend the MaxObject base class:</p>
<p><code><br />
import com.cycling74.max.*;</code></p>
<p>public class Reader extends MaxObject {<br />
...<br />
}<br /></p>
<p>if this is new to you, you should read &#8220;WritingMaxExternalsInJava.pdf&#8221; which is somewhere inside the javadoc folder.</p>
<p>> This displays a text file in Terminal, though it displays the entire contents of this.</p>
<p>actually it displays the text one line after the other, but it happens so fast, that you can&#8217;t see the individual lines being printed. the while-loop is doing this, by reading a line from the bufferedReader, checking whether the end has been reached, and if not, simply outputting the string to the console.</p>
<p>so, if you want to request every line separately from max, you should change something about the while loop.<br />
probably you want to add a new method to you class, so in max you can send a &#8220;bang&#8221; (or whatever) message to the object, to retrieve a new line of text. therefore at least the BufferedReader has to be global, so you can access its contents from different places.<br />
hope that helps.<br />
vb</p>
						]]>
					</description>

					
					
				</item>

					
		
	</channel>
	</rss>

