I have a text file as below:
BRANCH :SARDAR BHILADWALA PARDI PEOPLE'S CO-OP. ,Head Office NODE : 9
BRANCH CODE : 1 RUN DATE :11/05/2009 USER : SNA
REPORT ID :R048260 * AREA WISE MEMBER LISTING OF SHARE CUSTOMERS ** PAGE : 1
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
Selection :- Product Code : SHM SHARE CAPITAL
All/Selected/Range : A ALL
Specific Area Code :
From Area Code :
To Area Code :
All/Selected/Range : A ALL
Specific Sub Area Code :
From Sub Area Code :
To Sub Area Code : 9999 **********
Skip Closed Accts : Y YES
As On Date : 31/03/2009
------------------------------------------|
| Area Code : 1 PARDI |
------------------------------------------|
| Sub Area Code : |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Sub Sub Area Code: |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Sr.No | Membership No | Name | Addresss | Occupation |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------
| | 35957 | SHAH HEMANGINI KANAIYALAL NATVARLAL |SHROFF STREET,, KILLA PARDI, DIST.VALSAD, Pardi, Pin Cd : 396125 |
| 1 | 35959 | SARSIWALA SAKINABEN ASGARALI ABDULHUSEIN |OPP.HIGHPOWER SODA FACTORY,, DUNGRI FALIA,DAMNI ZAPA,, KILLA PARDI.DIST.VAL |
| 2 | 36022 | PATEL BHARTIBEN BABUBHAI KHANDUBHAI |B/H BALMANDIR,, KANSARWAD,, KILLA PARDI., Pardi, Pin Cd : 396125 |
| 3 | 36023 | PATEL ASHISHKUMAR BABUBHAI KHANDUBHAI |B/H BALMANDIR,, KANSARWAD,, KILLA PARDI., Pardi, Pin Cd : 396125 |
| 4 | 36025 | SHAIKH HALIMABIBI UMARBHAI MOHMEDBHAI |OPP.JALARAM KHAMAN HOUSE,, CHIVAL ROAD,, KILLA PARDI.DIST.VALSAD, Pardi, Pi |
| 5 | 36072 | LAD PUSHPABEN VINODBHAI BHANABHAI |KUMBHARWAD,, VALSADI ZAPA,, KILLA PARDI,DIST.VALSAD, Pardi, Pin Cd : 396125 |
| 7 | 36076 | KOTHARI PANNABEN JANAKBHAI ISHVARLAL |VANIAWAD,, KILLA PARDI, DIST.VALSAD, Pardi, Pin Cd : 396125 |
| 8 | 36080 | PATEL DHARMESH BHAGUBHAI KANJIBHAI |NEAR RATAN RICE MILL,, DAMNI ZAPA,, KILLA PARDI., Pardi, Pin Cd : 396125 |
| 9 | 36081 | MAPARA BANKIMKUMAR SUNDARLAL HARJIVANDAS |BALAKHADI,, STATION ROAD,,
From this text file I want to read only "AREA CODE :" word and then the text after "AREA CODE :" needs to be stored in a variable.
I am able to read file also find the word but my problem is I am getting all lines which contain "AREA CODE:".Instead I need only "AREA CODE : 1 PARDI" from text file...
My current code
[Added code from OPs comment] Milind
objStreamReader = New StreamReader("E:\Rachna\ELECTION 2009-SHAREHOLDERS AREAWISE.txt")
strLine = objStreamReader.ReadLine
Do While Not strLine Is Nothing
If strLine.ToUpper.Contains("Area Code :".ToUpper) Then
strLine.Trim()
strAreaCode = Split(strLine, " ")
End If
strLine = objStreamReader.ReadLine
Loop
objStreamReader.Close()
This is code where File is read and "AREA CODE :" word is found. But it retuns line "From Area Code :" from txtfile which I dont need.
Can any1 please help me?