Results 1 to 2 of 2
Thread: Output Issue
- 08-04-2008, 10:52 AM #1
Output Issue
Hi Folks,
Input Text:
S.No Description Qty Amount in Rs
1 Tower Building Works (ABC) As per Annexure 282,813.00
2 Tower Building Works (ABC) As per Annexure 282,812.00
3 Tower Building Works (ABC) As per Annexure 282,815.00
Is there any thing wrong??String sub1=null;
String endsub1=null;
Matcher sub=Pattern.compile("S.No\\s+Description").matcher (data);
while(sub.find()){
// System.out.println(sub.group());
sub1=sub.group();
//System.out.println(sub1);
}
Matcher endsub=Pattern.compile("Invoice\\s+value").matcher (data);
while(endsub.find()){
endsub1=endsub.group();
// System.out.println(endsub1);
}
data=data.substring(data.indexOf(sub1),data.indexO f(endsub1));
// System.out.println(data);
String remove=null;
Matcher rmv=Pattern.compile("S.No\\s+Description\\s+Qty\\s +Amount\\s+in\\s+Rs").matcher(data);
while(rmv.find()){
remove=rmv.group();
}
data=data.replace(remove,"");
System.out.println("Sub string "+data);
// data=data.replace(" ","");
// System.out.println(data);
table=data.split("\t+");
for(int i=0;i<table.length;i++){
System.out.println(" "+(i+1)+" "+table[i]);
}
Output:
1
Tower Building Works (ABC)
As per Annexure
282,813.00 2
Tower Building Works (ABC)
As per Annexure
282,812.00 3
Tower Building Works (ABC)
As per Annexure
282,812.00
Desired Output:
S.No: 1
Description:Tower Building Works (ABC)
Qty: As per Annexure
Amount: 282,813.00
S.No:2
Description: Tower Building Works (ABC)
Qty: As per Annexure
Amount: 282,812.00
S.No: 3
Description:Tower Building Works (ABC)
Qty: As per Annexure
Amount: 282,815.00visit : www.yoteam.co.cc
- 08-04-2008, 10:56 AM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
Rather compile with the prefix part try to add them when you print the results.
Similar Threads
-
different output
By pro85 in forum Java AppletsReplies: 6Last Post: 08-05-2008, 01:42 PM -
Why the output is always zero
By mehrotra.chitij in forum New To JavaReplies: 12Last Post: 04-25-2008, 04:05 AM -
output
By Camden in forum New To JavaReplies: 3Last Post: 12-01-2007, 10:34 PM -
Issue
By chaitu444 in forum New To JavaReplies: 2Last Post: 11-06-2007, 07:49 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks