aspose file tools
The moose likes Java in General and the fly likes partial string extraction Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply locked New topic
Author

partial string extraction

pavithra murthy
Ranch Hand

Joined: Feb 06, 2009
Posts: 53
hello all ,

from the string "MRN 09DE588004180289E0" i have to extract only the 18 digit number after MRN . this is actually present in a output.doc file . I am currently not able to extract that from the file even after using file writer .
when i run no output is coming and output should actually be 09DE588004180289E0 on the command prompt
could anyone please help me out

Balu Sadhasivam
Ranch Hand

Joined: Jan 01, 2009
Posts: 874



# int valStartIndex = line.indexOf(search) + search.length()+ 1;
#
# int valEndIndex = line.indexOf(search) + search.length()+ 1 + 13;


Pavithra,

You are short of length ? What does 13 signify ?
I guess here valStartIndex = 0+3+1 = 4 , valEndIndex = 4+14 = 18. But your String length ""MRN 09DE588004180289E0" is 22 ?
Rob Spoor
Sheriff

Joined: Oct 27, 2005
Posts: 19216

Please Use One Thread Per Question. Let's continue here.


SCJP 1.4 - SCJP 6 - SCWCD 5
How To Ask Questions How To Answer Questions
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: partial string extraction
 
Similar Threads
how to extract search engine results
string extraction by giving position as first argument in command prompt
program to extract the full string based on requirement
string extraction using regular expressions
regular exression for concatenating string in 2 different lines into the same line