Originally posted by Anil Sadineni:
Hi All,
How can I find out the number of lines in a Microsoft word document file. Is it possible through java? How can I get the number of lines in it. If any one knows the solution, please give the reply for this.
Yes you can, but it's not easily. Using the java.io package you can access the file and read in the data, as murali suggested. However, you're on your own to parse the data to determine what the lines are. This means you need to find out what the file enocding is, remove the document information so you just have the content, and then you must parse the content. That's probably not so easy.
(Actually, I think the number of lines might be some document data stored in the
word file, so maybe you only need to figure out what the encoding is, and then just look for that piece of data.)
--Mark