• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Property File - property value break on multiple line

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I wrote property file where I need to define a sequence in which property values to be read. so far declaring sequence was okay but sequence i defined is getting so long I need to scroll horizontally to see all listing

is there any way I can define value on multiple line so i don't need to scroll ?

property file is :

#### Lead Export File Content ###
EXPORT_HEADER=LEADID,CREATED_ON,DATE_TIME,ADAPTOR, FIRST_NAME,LAST_NAME,ADDRESS,CITY,STATE,ZIP_CODE,E DUCATION_LEVEL,DEGREE_OF_INTEREST,INFODEGREE,PROGR AM,INFOPROGRAM,INFOAREACODE1,INFOPHONE1,INFOAREACO DE2,INFOPHONE2,BEST_TIME_TO_CALL,E-MAIL, ARE_YOU_AFFILIATED_WITH_THE_US_MILITARY,ARE_YOU_IN TERESTED_IN_RECEIVING_FINANCIAL_AID,INFOCAMPUS,REM OTE_ADDR,INFOVENDORID,INFOUNIQUEID,CID,UID,AFID

 
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The java.util.Properties class javadoc states that:


A natural line is defined as a line of
characters that is terminated either by a set of line terminator
characters (<code>\n</code> or <code>\r</code> or <code>\r\n</code>)
or by the end of the stream. A natural line may be either a blank line,
a comment line, or hold all or some of a key-element pair. A logical
line holds all the data of a key-element pair, which may be spread
out across several adjacent natural lines by escaping
the line terminator sequence with a backslash character
<code>\</code>
.



Therefore, try:
#### Lead Export File Content ###
EXPORT_HEADER=LEADID,CREATED_ON,DATE_TIME,ADAPTOR, FIRST_NAME,LAST_NAME,ADDRESS,CITY,STATE,ZIP_CODE,\
EDUCATION_LEVEL,DEGREE_OF_INTEREST,INFODEGREE,PROGR AM,INFOPROGRAM,INFOAREACODE1,INFOPHONE1,\
INFOAREACODE2,INFOPHONE2,BEST_TIME_TO_CALL,E-MAIL, ARE_YOU_AFFILIATED_WITH_THE_US_MILITARY,\
ARE_YOU_INTERESTED_IN_RECEIVING_FINANCIAL_AID,INFOCAMPUS,REM OTE_ADDR,INFOVENDORID,INFOUNIQUEID,CID,UID,AFID

 
Shardul Vyawahare
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks ,

Worked fine

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I have a similar requirement, but there is a problem in my case.

key = value/
value/
value/
value/
value/
value/
value/
value/
value/
value/

When I read the values of key, I am seeing that the last values are getting lost.

I could read only first 7 lines or so, I was wondering if I have to set some length of the values that I need to read.

Can you please help me in this?
 
naveen velicheti
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
oops...... found the issue

I came to know that I have left a ' ' space character after one of the '/', So the getProperty read till that point and skipped the rest.


Thanks


 
If you two don't stop this rough-housing somebody is going to end up crying. Sit down and read this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic