Reading specified format text from text file

S

srikanthv

I have below Sample text. I need find in the text specfic "Key name"
its Value "HKEY_CURRENT_USER\Control Panel\International", If I find
this I need to go inside of this and read Value 0 (Name: Its value and
Data: Its value),Value 1 (Name: Its value and Data: Its value)....Value
N (Name: Its value and Data: Its value).

Please provide me same code for this.

Sample
-------
Key Name: HKEY_CURRENT_USER\Control Panel\Input Method\Hot
Keys\00000202
Class Name: <NO CLASS>
Last Write Time: 8/7/2006 - 7:07 PM
Value 0
Name: Key Modifiers
Type: REG_BINARY
Data:
00000000 03 c0 00 00 .À..
Value 1
Name: Target IME
Type: REG_BINARY
Data:
00000000 00 00 00 00 ....
Value 2
Name: Virtual Key
Type: REG_BINARY
Data:
00000000 4c 00 00 00 L...

Key Name: HKEY_CURRENT_USER\Control Panel\International
Class Name: <NO CLASS>
Last Write Time: 8/7/2006 - 7:07 PM
Value 0
Name: iCountry
Type: REG_SZ
Data: 1
Value 1
Name: iCurrDigits
Type: REG_SZ
Data: 2
Value 2
Name: iCurrency
Type: REG_SZ
Data: 0
Value 3
Name: iDate
Type: REG_SZ
Data: 0
Value 4
Name: iDigits
Type: REG_SZ
Data: 2
..
..
..
Value N
Name: iLZero
Type: REG_SZ
Data: 1
 
I

Izzy

Is this a homework assignment? I can provide you with code to do this,
I'm just curious if this is a school homework assignment.

Izzy
 
S

srikanthv

Yeah, Home work only
Is this a homework assignment? I can provide you with code to do this,
I'm just curious if this is a school homework assignment.

Izzy
 
I

Izzy

That's what I thought. In that case, check out StreamReader in the
MSDN. You can find a StreamReader in the System.IO namespace.

This will show you everything you need to read text line by line from a
file. Once you find specific lines your looking for then check into
String functions on how to parse the required data.

I could give you code to do all this but then you wouldn't be learning
anything. I'll continue to watch this thread so post back if you get
stuck.

Izzy
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top