|
Like so...? sorry in advance about the formatting
public class demo
{
/**
* @param args
*/
;
public static void main(String args[])
{
String data = null;
try
{
FileReader fr = new FileReader("C:\\Development\\demo.txt");
BufferedReader br = new BufferedReader(fr);
data = new String();
while ((data = br.readLine()) != null)
{
System.out.println(data);
}
int len = data.length();
for (int j = 0; j < len; j = j + 2)
{
data.charAt(j);
System.out.println(j);
}
for (int j = 0; j < len; j = j + 2)
{
data.charAt(26);
System.out.println(j);
}
}
catch (IOException e)
{
System.out.println("IOException error!");
e.printStackTrace();
}
}
}
|