Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners to read a file and seperate vowels and consonants to other files

Have Programming Question? Ask it here!
 
 
 


v.lavanya
to read a file and seperate vowels and consonants to other files
0 Answer(s)      2 years and 3 months ago
Posted in : Java Beginners


import java.io.*;
public class alpha {
public static void main(String[] args)throws IOException
{

try
{
    FileInputStream fstream = new FileInputStream("C:/Documents and Settings/549176/Desktop/atoz.txt");
    DataInputStream in = new DataInputStream(fstream);
    BufferedReader br = new BufferedReader(new InputStreamReader(in));

    FileWriter ostream = new FileWriter("C:/Documents and Settings/549176/Desktop/vowels.txt");
      BufferedWriter out = new BufferedWriter(ostream);
      FileWriter opstream = new FileWriter("C:/Documents and Settings/549176/Desktop/consonants.txt");
      BufferedWriter outt = new BufferedWriter(opstream); 

     String str=br.readLine();
     char ch;        
     for (int i=0;i<str.length();i++)
     {
         ch = str.charAt(i); 


      if(( ch == 'a') ||( ch == 'e') ||( ch == 'i') ||( ch == 'o') ||( ch == 'u')) 

    {
        out.write(ch);
    }
          else
          {
              outt.write(ch); 
          }

      }

     out.close();
      outt.close();
      br.close(); 
}
catch (Exception e) {
    System.err.println(e);
  }

    }

}

Advertisement
View Answers

Related Tutorials/Questions & Answers:
to read a file and seperate vowels and consonants to other files
to read a file and seperate vowels and consonants to other files  import java.io.*; public class alpha { public static void main(String[] args)throws IOException { try { FileInputStream fstream = new FileInputStream
vowels and consonants
vowels and consonants   import java.lang.String; import java.io.*; import java.util.*; public class Vowels{ public static void main(String args[])throws IOException{ File aa = new File("C
Advertisements
vowels
vowels  program to count the number of vowels in a given array of characters   Hi Friend, Try the following code: import java.util....++; } } System.out.println("There are" + " " + count + " " + "vowels
vowels
vowels  how do u encryp vowels from given wordes?   import java.util.*; class EncryptVowels { public static void main(String[] args) { Scanner input=new Scanner(System.in); System.out.println("Enter
read a file
read a file  read a file byte by byte   import java.io.File... static void main(String[] args) { File file = new File("D://Try.txt"); try { FileInputStream fin = new FileInputStream(file); byte
Count Vowels
Count Vowels   Read a string from the user, your program counts the number of vowels in the text and have it report a sum of each vowel found as well as the number of spaces. Make it in two classes
file read
file read  hi i am reaing from a file which has punjabi words. can some one help with me some code
Java read text file
a text file one line at a time. It can also be used to read large text files... by other program. Here we have used DataInputStream class to read the text file...; + e.getMessage()); } } } The other way to Read file line by line is by using Scanner
Java read multiple files
Java read multiple files In this section you will learn how to read the data of multiple files. Here we have created four files that includes information of students of a class. Each file contains a student's name, email, school and hobby
Read external file in PHP
Read external file in PHP  How to read external files in PHP in particular time duration and save that file with the latest date. How is it possible? Please explain with an example. Thanks
Java read binary file
Java read binary file  I want Java read binary file example code that is easy to read and learn. Thanks   Hi, Please see the code... more examples at Java File - Learn how to handle files in Java with Examples
how to read files of directory objective c
how to read files of directory objective c  how to read files of directory in objective c?   [[NSFileManager defaultManager] contentsOfDirectoryAtPath:bundleRoot error:nil]   To read the text file using
Read file in java
Read file in java  Hi, How to Read file in java? Thanks   Hi, Read complete tutorial with example at Read file in java. Thanks
java read file
java read file  Hello i need some help... i want to read an MS Excel file in java so how to read that file
how to read and write xml files in javascript
how to read and write xml files in javascript  hi m very new to javascript and xml,, now i want to read and write xml files in javascript,, please give me a sample code to do
Read and write file
Read and write file  HI, How to read and write file from Java program? Thanks   Hi, See the following tutorials: Java Write To File Read File Thanks
Read from file java
Read from file java  How to Read from file java? What is the best method for a text file having a size of 10GB. Since i have to process the file one line at a time so tell me the very best method. Thank you
J2ME Read Multiple File - MobileApplications
J2ME Read Multiple File  Hello I have read a topic "J2ME Read File", but that example is specify for a single file, but what if i want read more file one after the other just like Books. And an example will i appreciate thanks
Read Video File
Read Video File  how to read a video file, after that i want to encrypt and decrypt it. please help me and if u can send me some hint or source code on swarit.it@gmail.com Thanks & Regards Swarit Agarwal
Read the file Contents
Read the file Contents  Ravi Raj,Vijay45Shankar,234 Guna,345,Meet me,654,Cow Read file contents and Print the no.of words and Numbers./p> Thanks, Dinesh Ram   The given code read the file content and print
Read text File
Read text File  Hi,How can I get line and keep in a String in Java
java program to read multiple files from a directory and display them on a jframe
java program to read multiple files from a directory and display them on a jframe  hi guys i want to write a java program that will read all files... word contained in the file e.g doctor with next next mode. regards Kenny
Read the Key-Value of Properties Files in Java
Read the Key-Value of Properties Files in Java  ... to read the key-value of properties files in Java. This section provides you an example for illustration how to read key and it's regarding values from
read restricted pdf file
read restricted pdf file  i have restricted file. package Encryption; import java.io.*; import java.util.*; import com.lowagie.text.*; import com.lowagie.text.pdf.*; public class EncryptionWithCertificate { public
read restricted pdf file
read restricted pdf file  i have restricted file. package Encryption; import java.io.*; import java.util.*; import com.lowagie.text.*; import com.lowagie.text.pdf.*; public class EncryptionWithCertificate
Java read latest file
Java read latest file Java provides IO package to perform file operations. Here we are going to read the last modified file. For this, we have used..., read that particular file. Here is the code: import java.io.*; import
objective c read file line by line
objective c read file line by line  Please explain how to read files in Objective C line by line
File Upload and Retrive files
File Upload and Retrive files  Can any body help me am getting an error in uploading file. into mysql database.... thank's in advance
Java read properties file
Java read properties file In this section, you will learn how to read... files. Now to load the data from the properties file, we have used Properties... can read any properties file. Output: Name: RoseIndia
read and write a file using javascript
read and write a file using javascript  How to read and write a file using javascript
read doc and docx file in javascript
read doc and docx file in javascript  How i read doc and docx file in javascript
Java Read CSV file
Java Read CSV file In this tutorial, you will learn how to read csv file. CSV... and there is no need of using any API to read these files. In the given example, we have opened a file data.csv  and created a BufferedReader object to read
Read Lines from text file
Read Lines from text file  Here's a brief desc of what my Java code does .. I'm using BufferedReader to read lines from a text files and split each... read from the text file and displays the output as desired. Unable to read the rest
How to read PDF files created from Java thru VB Script
How to read PDF files created from Java thru VB Script  We have created the PDF file thru APache FOP but when we are unable to read the data thru... to read the FOP pdf? Is their any tool which convert the Apache FOP to Adobe PDF
NUMBER OF VOWELS IN A WORD
NUMBER OF VOWELS IN A WORD  WRITE A PROGRAM THAT WILL INPUT A WORD THEN IT WILL DETERMINE THE NUMBER OF VOWELS PRESENT IN THE INPUTTED WORD
Read file zip in J2ME - MobileApplications
Read file zip in J2ME  I would like to read file.zip in J2ME,I don't know how to extract it. Please help me
Converting Text Files into Bzip File
Converting Text Files into Bzip File  Hi, I am facing the problem during run the program, when converting text files into Bzip file. Please guide me how do i convert the text file into bzip file in PHP. I will welcome, if anyone
Read Property file From Jmeter
Read Property file From Jmeter  Hi, I am running web driver script from Jmeter, but while reading property file I am getting "File Not Find Exception". Please tell me how to read ".properties" file from Jmeter
How to move a file from a directory to other directory
How to move a file from a directory to other directory  I tried the above example it will move the folder to other directory but it does not move the image file or other file to a specified directory. Can anyone help me? Thanks
Java read file in memory
Java read file in memory In this section, you will learn how to read a file... and then read the file... for the  file, and then call map( ) to produce a MappedByteBuffer, which
Java file read write operation
Java file read write operation  how to read and write the data from text file.Suppose i have text file with 4 fields name ,roll no ,marks1,marks2... to the other class.Suggestion please   hi Dhirendra, here I am giving
Programming - Count Vowels - main
a method to get the number of vowels. Details Loop. Read the input... Java: Programming - Count Vowels - main Problem Write a program that reads a string and displays the number of vowels in it. This main program program
Java to create table in jsp file that include other jsp file
Java to create table in jsp file that include other jsp file  String jspContent = "table" += "tr" += "td" += "jsp:include page='fileSource... this http://www.roseindia.net/tutorial/java/core/files/javacreatetableinHTML.html
How to Read a File in Java
How to Read a File in Java? In this section we are going to know, How to read a file in Java. We have to follow three step to read a File. First get... to read the Content of file . Read A File: Reading a file is nothing
File I/O - Text Files
Java NotesFile I/O - Text Files Java can read several types of information from files: binary, Java objects, text, zipped files, etc. One of the most.... File inFile = new File(in.next()); // File to read from. File
Java read lines from file
to read the whole file in one go. So, in my case reading file line by line is only...Java read lines from file  Any code example related to Java read lines from file? In my project there is requirement of reading the file line by line
Read PDF file
Read PDF file Java provides itext api to perform read and write operations with pdf file. Here we are going to read a pdf file. For this, we have used PDFReader class. The data is first converted into bytes and then with the use
how to read this xml file - XML
how to read this xml file  i want to read this xml file using java... read i have tried lot more , but i am not able to read this xml file... name=client menu=client action=read user employee add
J2ME Read File
J2ME Read File       In this J2ME application, we are going to read the specified file. This example shows you how to read the data of the specified file. To implement this type
Read file into String
Read file into String In this section, you will learn how to read a file... data from the file using it's read() method. This data is then stored... we have used FileReader and BufferedReader class to read the file into memory
 

 

 

DMCA.com