aspose file tools*
The moose likes Java in General and the fly likes Problem in parsing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem in parsing" Watch "Problem in parsing" New topic
Author

Problem in parsing

Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Hi, Ranchers I am parsing one string with split() method. But Output is not getting what I expected. following is my code:


I want output as :



But I got output as



Means after every line one space is added. How to get expected output? Thanks in advance

>


Life is easy because we write the source code.....
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

You probably want this as regex "[|$^]+"
But then there are still empty lines in your result.


"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Wouter Oet wrote:You probably want this as regex "[|$^]+"
But then there are still empty lines in your result.


Thanks Wouter for your reply. Yes you are right now I get output as


How to remove this empty line?
Pramod P Deore
Ranch Hand

Joined: Jul 15, 2008
Posts: 629

Ohh My Bad

You are right Wouter Oet. There is a blank line because string itself contains one space. Thank you very much.
Wouter Oet
Saloon Keeper

Joined: Oct 25, 2008
Posts: 2700

Glad I could help.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem in parsing
 
Similar Threads
Simple Hibernate Help (Im Noob)
SSL error
How to get Yesterday's date
OC4J 10g StandAlone using HTTPS Tunneling Problem
date format conversion to MM/dd/yyyy hh:mm a