The following code works on my Mac and not on the pc. I really need to start working on the pc, so I appreciate any help I can get. I'm using Eclipse Java Oxygen on both platforms.
Code:
import java.io.BufferedReader;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.io.PrintWriter;
public class coordinates {
public static void main(String[] args) {
try {
BufferedReader in = new BufferedReader(new FileReader(new File("C:\Users\TelmoG\Desktop\06092017.txt")));
PrintWriter out = new PrintWriter("C:\Users\TelmoG\Desktop\outputFile.csv");
String newLine ="";
int index = 0;
String line = "";
while((line = in.readLine()) != null){
// System.out.println(line);
index++;
if (index %2 == 0){
newLine += ";" + line.substring(34);
out.println(newLine);
} else {
newLine = line.substring(34);
};
}
in.close();
out.close();
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
}
}
Error:
Exception in thread "main" java.lang.Error: Unresolved compilation problem:
at coordinates.coordinates.main (coordinates.java:25)
Line 25:
public static void main (String [] args) {