Uppercase File Converter


Writing up a code part this asks the user for the names of two files. First file should be for reading and the seconds 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();
}
}Such the trouble i am managing into is this i can Create the new file but it will only save the spelling in upper case of my filename1 not its contents. Some advise with this would be incredibly thankful.



View Complete with Replies


RELATED TOPICS OF Java PROGRAMMING LANGUAGE




Hi DIC i have trouble with adding a "movie" to a file

DIC i have a trouble with my code part where i am making such this 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 trouble is this it adds the command "add up movie" an
VIEWS ON THIS POST

10

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

Error in counting spelling in a file.

My program will not count the spelling in a file. The suggest of the program is to read in a file then determine the amount of spelling in it.
Thanks for the advise
Push
import java.io.BufferedInputStream;
import java.io.DataInputStream;
import java.io.F

VIEWS ON THIS POST

17

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

JFileChooser: Not having the file.


Im getting a trouble with my JFileChooser .Im making a sort of syntax reader.
This suports complex and simplistic things (atm simplistic )
But now
it seems it doesn't come tho this function
Such,
here is the file chooser :
@Over

VIEWS ON THIS POST

15

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

draw line in kml file using two points longitude/latitude

I made a code part to produce our network stations in a kml( google earth) file using it is longitude and latitude. But in here i cannot Create links (draw lines) b'tween them. such plz advise me. in here I used those packages.
import

VIEWS ON THIS POST

16

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

Reading files

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

VIEWS ON THIS POST

9

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

Copy some file type using java

I tried to copy some files using java by using classes used in reading text files...
But it is not working...Can Someone deliver me a Gurus to copy an exe file from one folder to another

VIEWS ON THIS POST

22

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

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

Can some Gurus tell me who was doing that How can that happen I swear this if this damn shit ashole can be captured after I catch 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 some
VIEWS ON THIS POST

27

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

Read a file into dissimilar array list

friends I have a program that reads in a file with 7 dissimilar list of numbers, but i wish to put the list into dissimilar array list, and then do some computations on the list, but i dont understand how to put them into the array list to begin with. that
VIEWS ON THIS POST

9

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

How to select raw data in a row of text file?

GuysI am newcomer to that Java program if Someone could help me find resolution to that issue. I've found a program which to read a text file. That program will to show what is raw data inside the Text file.
Here's the code part:
i

VIEWS ON THIS POST

9

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

15

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

text file into 2d char array using bufferedReader

My trouble is I am struggling to read a text file into a 2d array of char but I cannot catch it to work. I understand the solution is to open the file then read it, and catch how much lines there are and use this as the first index of the 2d ch
VIEWS ON THIS POST

40

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

Binary file to ComboBox

Such my final project for Java class is complete. I have a Javaphone Object, and in that Object I made 3 arrays of Strings (firstname, lastname, phone). I then compose those "Contacts" to a binary file. Technically, this's all I wish to do.
But I

VIEWS ON THIS POST

18

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

How to save web form 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

16

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

java swing examine two txt. files line by line

Hİ everybody. I have completed my code part two txt files by viewing on the same area.
but I wish to examine two txt files line by line. and I wish to view the differences with Colored lines and finally, The letter or spelling this are

VIEWS ON THIS POST

26

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

require major advise with validating ISBN with reading and inputing files

only the first nine digits in an ISBN are used to often identify a book. The tenth character serves as a check digit to verify this the preceding 9 digits are properly formed. This check digit is selected such this the value computed as shown in the following algor
VIEWS ON THIS POST

34

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

how to read a file into array

How can i crack dis project. Someone with anykind of description or step by step Gurus
Use appropriate classes and methods to implement a Java program that reads the ASCII file (see underneath) sequentially into an array . ASCII FILE
MA441Casablanca

VIEWS ON THIS POST

7

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

how to catch 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

18

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

Converting first character in a word to uppercase?

I understand this strings have the toUppercase and toLowercase or however tgo, but how would you use the toUppercase to convert just the first letter of a word to uppercase Is this possible
I have a list of names this Anyone made some of them all uppercase, some

VIEWS ON THIS POST

20

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

how to alter lowercase to uppercase

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

VIEWS ON THIS POST

19

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

convert Many spelling to uppercase

this program is supposed to accept a string and convert all lowercase letters to uppercase. My trouble is this only the first word in uppercase is being printed out.
For illustration if I enter " ***, how are you"
it should print: THERE ***, HOW ARE YOU
import java.util

VIEWS ON THIS POST

17

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

  • T = 0.03

  • Copyright 2012 © SolveThisError.com. All rights reserved. Terms of use  |  Privacy Policy