Text file colon and space separated file
<p>I have a file wordTopic.txt.And the file is of the form:</p>

<pre><code>208:4 208:1 1049:2 3059:15 73684:10 715:15 6100:7 1129:15 1276:2 722:6 4809:1 726:15 6456:5 3703:10 1634:11 14342:13 13785:15 8930:6 61497:11 5435:15 327:1 327:1 228:8 7186:14 10229:2 13787:15 14683:3 437:7 1232:7 3272:15 127:15 9731:0 2367:6 957:8 957:8 810:15 11952:5 18459:5 35248:6 24209:6 19155:3 364:1 364:1 2550:15 7169:15 10939:15 35249:11 4039:8 21608:13 2612:7 1006:15 1113:15 87090:14 1423:8 2180:3 1375:15 270:9 2309:2 533:11 9204:15 660:16 17071:13 
</code></pre>

<p>Above is one row of the file and each row will have different length</p>

<pre><code>wordid:topicid wordid:topicid wordid:topicid........
</code></pre>

<p>I want only the topic ids to be stored in an array. How can I take the topic id (i.e.) how can I store the number after colon. Topic ids will be from 0 to 19 only.</p>