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 6583881
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:28:00+00:00 2026-05-25T16:28:00+00:00

I am loading data from a resource within my own application, and the escape

  • 0

I am loading data from a resource within my own application, and the escape characters I place are not being processed the way I expect them to be. For example, a line in my resource would look like this:

Ellington Human Sciences Building<>EHS<>Human Performance Sciences Building\nNeighbor to Ellington Human Sciences Annex (EHSA)<>292<>482<>73<>25<>Human Sciences
Ellington Human Sciences Annex<>EHSA<>Human Performance Sciences Building\nNeighbor to Ellington Human Sciences Building (EHS)<>340<>464<>28<>20<>Human Sciences

my file reader looks like so:

private synchronized void loadPOIs(Resources resource) throws IOException {
    if (mLoaded) return;

    InputStream inputStream = resource.openRawResource(R.raw.pois);
    BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));

    try {
        String line;
        while((line = reader.readLine()) != null) {
            String[] strings = TextUtils.split(line, "<>");
            if (strings.length < 7) continue;
            POI poi = addPOI(strings[0], strings[1], strings[2], strings[3], strings[4], strings[5], strings[6]);
            if (strings.length == 8) {
                final int len = strings[7].length();
                for (int i = 0; i < len; i++) {
                    final String prefix = strings[7].substring(0, len - i);
                    addMatch(prefix, poi);
                }
            }
        }
    } finally {
        reader.close();
    }
    mLoaded = true;     
}

strings[2] would be the line holding the information about the Point of Interest, and they contain the “\n” character. When I call poi.getInfo() (the getter method of retrieving the info, returns a String) the output allows the “\n” to persist.

any ideas?

  • 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-05-25T16:28:01+00:00Added an answer on May 25, 2026 at 4:28 pm

    You are reading text from a file, and ‘\n’ is just as valid text as any other and does not have any special connotation within a text file. If you want a newline instead, then write a newline in your txt file. It’s sure easier than performing scaping over text, and you control the source of the data so there should be no trouble in modifying it.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I am loading data from a previous session into my application using the
I have an application that requires loading data from a network for a UITableView
I am loading data from external html files within my domain into a div
I suppose there's no way to use resource from exe without full loading it
We are loading data from db: var somethings = Context.SomethingSet.ToList(); Then someone deletes or
I'm loading data into a DataSet from an XML file using the ReadXml method.
I'm looking for the best way of loading formatted data in VBA. I’ve spent
I'm attempting to use the new standard way of loading seed data in Rails
I am developing an iPhone application in which I am loading lots of data
I've got a Flash movie, loading data from an external URL. In fact, it's

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.