File myfile = new File("c:\\testing.doc");
try
{
myrfile= new RandomAccessFile(myfile,"r");
String fileContent, asciiContent;
Character lineContent;
//read the text form file content line by line while((fileContent = myrfile.readLine())!=null)
{
while((lineContent=fileContent.readChar())!=null){
//now check each character whether it is printable or not
if (lineContent.isPrintable.. =="\n")//check for the syntax
System.out.print(lineContent);
}