evan224
asked on
reading a file, running toUpperCase then writing to another file
I am able to read Strings in and out of a .txt file. I am also able to apply toUpperCase to a String and output it to a .txt file. I cannot however capitalize a string that has been sucked from a .txt file. Plus using toUpperCase adds spaces after each of the characters.
Hope you can help, code is available.
evan224@hotmail.com
Hope you can help, code is available.
evan224@hotmail.com
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
evan224:
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
This old question needs to be finalized -- accept an answer, split points, or get a refund. For information on your options, please click here-> http:/help/closing.jsp#1
EXPERTS:
Post your closing recommendations! No comment means you don't care.
split, me and nir2002
i dont see the reason behind a 'C'.
some moderator can check on this.
some moderator can check on this.
import java.io.*;
public class test
{
public static void main( String[] args )
{
String line=null;
if(args.length >=2){
try
{
BufferedReader in = new BufferedReader(new FileReader( args[0] ) );
FileWriter out =new FileWriter(args[1]);
while ( (line =in.readLine())!=null ) // continue until end of file
{
System.out.println( line );
out.write(line.toUpperCase
}
in.close();
out.close();
}
catch ( IOException iox )
{
iox.printStackTrace();
}
}
else System.out.println("usage :: java test <inFile> <outUpperCaseFile>");
}
}