how to read txt file line by line
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/12370553/how-can-i-read-and-parse-the-contents-of-this-text-file">How can I read and parse the contents of this text file?</a>  </p>
</blockquote>



<p>I want read a text file as C++ read it</p>

<p>here is example from the text file</p>

<pre><code>(item(name 256) (Index 1)(Image "Wea001")   (specialty  (aspeed 700) (Hit 20)))
(item   (name 257)  (desc 520)           (Index 2)  (Image "Wea002")(specialty(Attack 16 24)))
</code></pre>

<p>I want the output like</p>

<pre><code>name : 256
Index : 1
Image : Wea001
Specialty &gt; aspeed : 700 
Specialty &gt; hit : 20
</code></pre>

<hr>

<pre><code>Name : 257
Desc : 520
Index : 2
Image : Wea002
Speciality &gt; Attack : 16 24
</code></pre>

<hr>

<p>Is that possible?</p>
