You are here:   HomeJava ProgrammingStreamCopying Contents after Converting Each Character in Capital in a File Java Example
by Dinesh Thakur Category: Stream

 

import java.io.*;

class ConvertingEachCharacter
{
                public static void main(String args[]) throws IOException
               {
                        BufferedReader k=new BufferedReader(new FileReader(args[0]));
                        PrintWriter h=new PrintWriter(new FileWriter(args[1],true));
                        String i;
                        FileReader fp;
                        FileReader fq;
                        try
                          {
                            fp=new FileReader(args[0]);
                          }
                             catch(FileNotFoundException e)
                                  {
                                     System.out.println("File cannot be found");
                                     return;
                                  }
                                      try
                                        {
                                           fq=new FileReader(args[1]);
                                        }
                                           catch(IOException e1)
                                                 {
                                                    System.out.println("File cannot be created");
                                                    return;
                                                 }
                                                    i=k.readLine();
                                                    while(i !=null)
                                                            {
                                                                 i=i.toUpperCase();
                                                                 h.println(i);
                                                                 System.out.println(i);
                                                                 i=k.readLine();
                                                             };
                                                                fp.close();
                                                                h.close();
               }
}

Copying Contents after Converting Each Character in Capital





Subscribe To Free Daily Newsletter!

Get Free News Updates Delivered Directly To Your Inbox
About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.SC (Computer Science), MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular Computer Notes blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to contact us.



What's New and Popular





Popular Article