dcsimg
How to read from a file
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   praveen_avvari
Posted On:   Tuesday, February 5, 2002 07:05 AM

Hi I have a text file ,i have to check only for a perticular sequence of numbers in the file . Here i am givining example:All the above represents to a single line in text file. TRNSEGSCAVSH 957877905 RELIANT, HL&P 364371679 NEW POWER, INC. 200111270258 ACTSEG269052488 20011129268683575_268684579 1008901007620639665100    More>>

Hi
I have a text file ,i have to check only for a perticular sequence of numbers in the file .
Here i am givining example:All the above represents to a single line in text file.


TRNSEGSCAVSH 957877905 RELIANT, HL&P 364371679 NEW POWER, INC. 200111270258 ACTSEG269052488 20011129268683575_268684579 1008901007620639665100 ADRSEG001S 526 MISTY LAKE SEABROOK TX 77586



in the above line u can find the below number
20011129268683575_268684579
in this i have to extract starting from 9th digit upto _



How can i do that
Thanks in advance
praveen    <<Less

Re: How to read from a file

Posted By:   Benoit_Quintin  
Posted On:   Tuesday, February 5, 2002 08:23 AM

Read the String, create a StringTokenizer, take each token and check for the match (String.indexOf and/or String.regionMatches()), use the index returned by the and get the substring...If you don't know how to do this, please check the Java API, available online.
About | Sitemap | Contact