Home All Groups Group Topic Archive Search About

Reading specified format text from text file

Author
23 Aug 2006 1:08 PM
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

Author
23 Aug 2006 2:29 PM
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


srikanthv wrote:
Show quoteHide quote
> 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
Author
23 Aug 2006 2:34 PM
srikanthv
Yeah, Home work only

Izzy wrote:
Show quoteHide quote
> 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
>
>
> srikanthv wrote:
> > 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
Author
23 Aug 2006 2:51 PM
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


srikanthv wrote:
Show quoteHide quote
> Yeah, Home work only
>
> Izzy wrote:
> > 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
> >
> >
> > srikanthv wrote:
> > > 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
Author
23 Aug 2006 4:12 PM
srikanthv
I did same way, what you said to me. Its working fine now.

Thanks buddy


Izzy wrote:
Show quoteHide quote
> 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
>
>
> srikanthv wrote:
> > Yeah, Home work only
> >
> > Izzy wrote:
> > > 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
> > >
> > >
> > > srikanthv wrote:
> > > > 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