• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

problem with reading text by POI Apache.

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Sheriff
Posts: 3064
12
Mac IntelliJ IDE Python VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Politics n. Poly "many" + ticks "blood sucking insects". Tiny ad:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic