0

I am doing some algorithmic problems on the website USACO, and for every submission they want us to make two files for input and output to test values. So if the problem was called "test", they would want users to make the files "test.in" and "test.out" which requires them to change their extensions to ".out" and ".in". How do I change their extensions from ".txt" to ".in" or ".out"?

Note: I am using Windows 8

Thank you

4
  • What programming language are you using?
    – Joe White
    Apr 8, 2014 at 23:44
  • Need a LOT more information. What language? What library/framework? Which version of Windows? What have you already attempted?
    – Alan McBee
    Apr 8, 2014 at 23:44
  • I am using Java with the Eclipse compiler. And I have attempted to make files in Eclipse but it turns into .txt. I am using the file reader library in Java. Apr 9, 2014 at 0:13
  • Seems more like a Java question than a Windows 8 one. While I don't know Java - there must be some move or rename method. Maybe the File.renameTo() method? Apr 9, 2014 at 1:27

1 Answer 1

0

To make Java read files in Eclipse

One must make sure that the words typed in the code and in the name of the file match each other. For example: The file referenced in must exist. BufferedReader f = new BufferedReader(new FileReader("test.in")); Also, you have to make the file under the project folder (in Eclipse or manually in Windows Explorer) because that folder is the directory at for that code, and if it is not in the folder the code will not be able to read it. You can also right-click the project to import files into the folder.

My reference: Trial and Error

http://www.coderanch.com/t/439615/java-io/java/Eclipse-won-read-text-file

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.