Uppercase File Converter


Writing up a code snippet that asks the user for the names of two files. First file should be for reading and the second file should be opened for writing. The program should read the contents of the first file alter all characters to uppercase, and store the results in the second file.
import java.util.Scanner;
import java.io.*;
public class fUpperCase
{
public static void main(String[] args)throws IOException
{
Scanner scan= new Scanner(System.in);

System.out.print("Enter the first file name");
String filename1 = scan.nextLine();
System.out.print("Enter the Second file name");
String filename2= scan.nextLine();

File file =new File(filename1);
Scanner inputFile= new Scanner(filename1);

while (inputFile.hasNext())
{
String fileRead = inputFile.nextLine();
String upperFileinput = fileRead.toUpperCase();

File file2 = new File(filename2);
PrintWriter outputFile = new PrintWriter(filename2);
outputFile.println( upperFileinput);

outputFile.close();
}
inputFile.close();
}
}So the difficulty I'm executing into is that i can generate the new file but it will only save the words in upper case of my filename1 not its contents. Any assistance By this would be extremely comprehended.


View Complete with Replies


RELATED TOPICS OF Java PROGRAMMING LANGUAGE




hey DIC I've difficulty with adding a "movie" to a file

DIC I've a difficulty with my code snippet where I'm making so that the textfield gets text from the textfield and saves it to a string and then the string writes the "movie" to the text file but my difficulty is that it adds the command "add movie" and not waiting
VIEWS ON THIS POST

2

Posted on:
Thursday, November 29, 2012
View Replies !

Error message in counting words in a file.

My program will not count the words in a file. The point of the program is to read in a file then determine the amount of words in it.
Thanks for the assist
Push
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.File;
import java.io.FileI

VIEWS ON THIS POST

4

Posted on:
Thursday, November 29, 2012
View Replies !

JFileChooser: Not getting the file.


Im having a difficulty with my JFileChooser .Im making a sort of syntax reader.
That suports complex and easy things (atm easy )
But now
it seems it does not come tho that function
So,
Here's the file chooser :
@Override
public void actio

VIEWS ON THIS POST

1

Posted on:
Thursday, November 29, 2012
View Replies !

draw line in kml file using two points longitude/latitude

I made a code snippet to create our network stations in a kml( google earth) file using it is longitude and latitude. But in here i can not create links (draw lines) b/w them. so pls assist me. in here I used these packages.
import javax.xml.parser

VIEWS ON THIS POST

4

Posted on:
Thursday, November 29, 2012
View Replies !

Reading files

Hello
I have a program that suppose to show the content of this file:
http: rapidshare.co...StudentData.txt
I was able to show the student number and the last name but now I am not able to show the test of the text's content decently.
If u'll

VIEWS ON THIS POST

2

Posted on:
Thursday, November 29, 2012
View Replies !

Copy any file type using java

I tried to copy some files using java by using classes used in reading text files...
But it isn't working...Can anybody provide me a guide to copy an exe file from one folder to another

VIEWS ON THIS POST

2

Posted on:
Thursday, November 29, 2012
View Replies !

Netbeans changed my file to be a read only file and discard all why?

Can any folks tell me who was doing this How can this happen I swear that if this damn shit ashole can be captured after I receive US$1000 bilyun, I will share 0,001 of it to behead this man's head but this will happen if I will not be punished by any laws. This human I mean in previous sent
VIEWS ON THIS POST

6

Posted on:
Thursday, November 29, 2012
View Replies !

Read a file into various array list

guys I've a program that reads in a file with 7 various list of numbers, but i need to put the list into various array list, and then do some calculations on the list, but i don't know how can i put them into the array list to begin with. this is what I've
VIEWS ON THIS POST

3

Posted on:
Thursday, November 29, 2012
View Replies !

How can i select data in a row of text file?

GuysI am newbie to this Java program if anybody could assist me By this. I have found a program which to read a text file. THis program will show what is data inside the Text file.
Here's the code snippet:
import java.io.BufferedReader;
impo

VIEWS ON THIS POST

2

Posted on:
Thursday, November 29, 2012
View Replies !

adding subfile in quotes


import java.io.File;
import java.io.FileNotFoundException;
import java.util.Scanner;
public class Expand {
final private static String STRING = "#include "";
main
public static void main(String[] args) {
String result = null;
File walker = new File(args[1]);
i

VIEWS ON THIS POST

2

Posted on:
Thursday, November 29, 2012
View Replies !

text file into 2d char array using bufferedReader

My difficulty is I'm attempting to read a text file into a 2d array of char but I can not receive it to work. I know the solution is to open the file then read it, and receive how several lines there are and use that as the first index of the 2d char
VIEWS ON THIS POST

3

Posted on:
Thursday, November 29, 2012
View Replies !

Binary file to ComboBox

So my final project for Java class is complete. I've a Javaphone Object, and in this Object I made 3 arrays of Strings (firstname, lastname, phone). I then spell these "Contacts" to a binary file. Technically, that's all I have to do.
But I am thinking I may need to

VIEWS ON THIS POST

5

Posted on:
Thursday, November 29, 2012
View Replies !

How can i save webpage in txt file


import java.awt.*;
import javax.swing.*;
import java.awt.event.*;
import javax.swing.event.*;
import javax.swing.text.html.parser.DTD;
import java.lang.Object;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.*;
impo

VIEWS ON THIS POST

1

Posted on:
Thursday, November 29, 2012
View Replies !

java swing equate two txt. files line by line

Hİ everybody. I've completed my code snippet two txt files by displaying on the same area.
but I need to equate two txt files line by line. and I need to display the differences with Colored lines and finally, The letter or words that are vari

VIEWS ON THIS POST

2

Posted on:
Thursday, November 29, 2012
View Replies !

want major assist with validating ISBN with reading and inputing files

only the first nine digits in an ISBN are used to recognize a book. The tenth character serves as a check digit to verify that the preceding 9 digits are correctly formed. This check digit is selected so that the value computed as shown in the following algorithm is evenly divisible by 11. Si
VIEWS ON THIS POST

7

Posted on:
Thursday, November 29, 2012
View Replies !

how can i read a file into array

How can I solve dis job. anybody with anykind of description or step by step guide
Use appropriate classes and methods to implement a Java program that reads the ASCII file (see given below) sequentially into an array . ASCII FILE
MA441Casablanca
CA127Montreal<

VIEWS ON THIS POST

2

Posted on:
Thursday, November 29, 2012
View Replies !

how can i receive uppercase method to work


import java.util.*;
public class WordFind
{public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
String word1 word2, word3, word4;
String puzzle;
System.out.println("Enter a three-letter word: " );
word1 = word1.toUpperCase();
wor

VIEWS ON THIS POST

2

Posted on:
Thursday, November 29, 2012
View Replies !

Converting first character in a word to uppercase?

I know that strings have the toUppercase and toLowercase or however tgo, but How will you use the toUppercase to convert just the first letter of a word to uppercase Is that possible
I have a list of names that somebody made some of them all uppercase, some all lowercase and some le

VIEWS ON THIS POST

2

Posted on:
Thursday, November 29, 2012
View Replies !

how can i alter lowercase to uppercase

I am attempting to turn a lowercase character into an uppercase character. The program will prompt the users to enter a character then it will show the character as is then will convert it into an uppercase character if want be.char aChar;
System.out.println("enter a char");

VIEWS ON THIS POST

2

Posted on:
Friday, November 30, 2012
View Replies !

convert More than one words to uppercase

this program is supposed to accept a string and convert all lowercase letters to uppercase. My difficulty is that only the first word in uppercase is being printed out.
For instance if I enter " ***, how are u"
it should print: THERE ***, HOW ARE U
import java.ut

VIEWS ON THIS POST

1

Posted on:
Monday, December 3, 2012
View Replies !