Hello, I have a problem when converting a string to integer...would you do me a flavour to see what the problem is? (the program cant be compiled successfully)
---------------
import java.io.*;
public class TEST {
public static void main (String args[]) throws IOException {
if (args.length != 1)
{
System.out.println("Please supply the parameter for this program."
;
System.exit(0);
}
FileReader fr = new FileReader(args[0]);
BufferedReader br = new BufferedReader(fr);
String line = null;
String s1 = null;
String newscontent = null;
int tmp_timestamp = 0;
while ((line = br.readLine()) != null) {
if (line.length() > 14 && line.substring(1, 1) != "#"
{
s1 = line.substring(line.length() - 14, line.length());
tmp_timestamp = Integer.parseInt(s1);
System.out.println(tmp_timestamp);
}
}
}
}
---------------
import java.io.*;
public class TEST {
public static void main (String args[]) throws IOException {
if (args.length != 1)
{
System.out.println("Please supply the parameter for this program."
System.exit(0);
}
FileReader fr = new FileReader(args[0]);
BufferedReader br = new BufferedReader(fr);
String line = null;
String s1 = null;
String newscontent = null;
int tmp_timestamp = 0;
while ((line = br.readLine()) != null) {
if (line.length() > 14 && line.substring(1, 1) != "#"
{
s1 = line.substring(line.length() - 14, line.length());
tmp_timestamp = Integer.parseInt(s1);
System.out.println(tmp_timestamp);
}
}
}
}