How To Read Data From NotePad Using Webdriver


This post helps you to Read Data from Notepad.This is so simple.By using two classes FileReader,BufferedReader we can read data.

import java.io.BufferedReader;
import java.io.FileReader;

public class read_notepad {

public static void main(String[] args) throws Exception
{
FileReader fr=new FileReader(“d:\\sample1.txt”);
BufferedReader br= new BufferedReader(fr);
String x=””;
while ((x=br.readLine()) != null)
{
System.out.println(x +”\n”);
}
br.close();

}

}

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s