• Post Reply Bookmark Topic Watch Topic
  • New Topic

problem with reading text by POI Apache.

 
Pezhman Na
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi, I wrote the code below to extract text from MS Word doc. it's working well except when it reads the last word of the paragraph I guess it read the new line as well, fro example when I retrieve the length of last token it returns the length of the token plus one.since I wanna compare this token with others I need to be only characters. I'd appreciate your idea to fix this bug, thanks


 
Greg Charles
Sheriff
Posts: 3010
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I don't know how MS Word delimits its lines, but a Windows text file uses \r\n. I don't see \r in your list of delimiters, so that could be it. You say the last token is one character bigger than you expect. Can you look at that last character? That would be the easiest way to diagnose the problem.
 
Pezhman Na
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Greg Charles wrote:I don't know how MS Word delimits its lines, but a Windows text file uses \r\n. I don't see \r in your list of delimiters, so that could be it. You say the last token is one character bigger than you expect. Can you look at that last character? That would be the easiest way to diagnose the problem.


thanks buddy, it worked properly
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!