hello i hope someone can help me i have this code which is looping though the vector and picking out the first word of a line then it loops though and picks out every 10th word so i get the first word of each line. but i want another loop so i can print out the second word of each line and the third and so on. any suggestions would be grateful thanks ben import java.io.*; import java.util.*; import java.lang.*; import java.util.StringTokenizer.*;
public class RT2 {
public static void main(String[] args) { String cT = null; String lT = null; try { Vector v = new Vector(100); FileReader file = new FileReader("Work.csv"); BufferedReader buff = new BufferedReader(file); String line = buff.readLine(); StringTokenizer s = null; boolean eof = false; while (!eof){ s = new StringTokenizer(line.trim(),",",true); while (s.hasMoreTokens()) { cT = s.nextToken(); if (cT.equals(",") && lT.equals(",")){ v.add(""); } else{ if (!cT.equals(",")) { v.add(cT); } } lT = cT;
} line = buff.readLine(); if (line == null) eof = true; } Enumeration e = v.elements(); Object o; for(int i = 0;e.hasMoreElements();i++) { o = e.nextElement(); if (i%10 == 0){ System.out.println(o.toString());