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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:03:12+00:00 2026-05-28T01:03:12+00:00

How to edit exactly without breaking the lines? I have a file test.ini and

  • 0

How to edit exactly without breaking the lines? I have a file test.ini and i just need to add a new record on it and later only modify it. But the following is crashing my existing file.

File: test.ini:

Existing correct version:

myname=C://
field=A=B

After modify it becomes:

myname=C\://
field=A\=B
newfield=blabla\n

Expected output was:

myname=C://
field=A=B
newfield=blabla

Code:

//import java.util.Properties;
try {
  Properties p = new Properties();
  p.load(new FileInputStream("/var/tmp/test.ini"));
  p.setProperty(key,fieldName);        
  p.store(new FileOutputStream("/var/tmp/test.ini"), null);        
  return p.getProperty(fieldName);
} catch(Exception e) {
  return null;
}
  • 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-28T01:03:12+00:00Added an answer on May 28, 2026 at 1:03 am

    Properties files don’t follow the same rules as “ini” files, notably they escape different characters – in your case it’s escaping colon and equals within data. See http://en.wikipedia.org/wiki/.properties

    You could use ini4j to handle the files in the appropriate way, or handle the escaping yourself after saving.

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

Sidebar

Related Questions

Edit: Of course my real code doesn't look exactly like this. I tried to
EDIT What small things which are too easy to overlook do I need to
Edit: It seems my test to determine whether the original JVM had exited was
I'm not sure how to word this exactly but I have a script that
I'm using a PersonEditHandler class in tipfy to edit a Person entity. I have
I'm using Fancybox and Zend. Hope the following is clear. On www.example.com/template/edit/id/3 I have
This is the code without any attempt to add var nn = 99 to
How can I get just the notes from org-mode heading without any technical stuff?
I need to implement a grid in asp.net that behaves almost exactly like MS
Today i typed git commit without the file name i was thinking of, and

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.