Reading data from excel and word files
Hello everyone I would likeread data from ms-excel file as well as ms-word file.
The code shown below read the entire content about the file but I need toread the original content of the file only.
//package index;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.*;
publicclass Str_parse1{
/* *
* reading data from word or excel file
*/
publicstaticvoid main(String[] args){
try{
System.out.println("Enter path..");
DataInputStream din =new DataInputStream(System.in);
String path = din.readLine();
//BufferedInputStream in = new BufferedInputStream(new FileInputStream(path));
FileInputStream ip =new FileInputStream(path);
int size= ip.available();
byte b[] =newbyte[size];
for(int i=0;i<size;i++){
{
b[i] = (byte)ip.read();
//System.out.print((char)b[i]);
}
}
for(int i=0;i<size;i++){
char t_char = (char)b[i];
//if( (t_char>64) && (t_char<91) || (t_char>96) && (t_char<123)||(t_char<48) && (t_char<65)){
//if(b[i]!=-1 && b[i]!=0){
//System.out.print(b[i]);
System.out.print((char)b[i]);
//}
//}
}
System.out.println("\n"+size);
/*while((in.read())!=-1){
System.out.print((char)in.read());
}*/
}
catch(IOException io){}
return;
}
}
plz give solution.for this problem.
thanks

