Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8630063
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:58:06+00:00 2026-06-12T08:58:06+00:00

I need to search through a word document for a string, and return the

  • 0

I need to search through a word document for a string, and return the "offset" of the first character. What I am unsure about is how to account for newlines. If the document consists of:

Hi

World.

What is the offset of ‘W’ – is it 2, since the offset of ‘i’ is 1? Or is it 3, because the hidden ‘\n’ could be considered a character? What if the document is using ‘\r\n’ carriage returns? Is there a standard way to deal with this (Java)?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T08:58:07+00:00Added an answer on June 12, 2026 at 8:58 am

    The answer is normalization:

    test.replaceAll("\r", "").indexOf('W')
    3
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to loop through the entire word document and read highlighted text so
I need to search through lucene.net document contains spaces between letters. example Document 1:
I use file_get_contents(http://www.mydomain.com); to get the content. Then I need to search through it
I need to be able to search through multiple 2D arrays and search the
I need to search a string in mysql with php. I get an error
I need to search for all users containing a certain text string in their
I have requirement where I need to allow users to upload a Word document
I need to perform a regular expression search for a string x in another
I need to sort and search through a dictionary. I know that dictionary cannot
I need to create a script to search through just below a million files

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.