Advertisement

08.08.2008 at 08:16AM PDT, ID: 23632983 | Points: 125
[x]
Attachment Details

How do I search a text file for a string that has a hex value that follows it and then convert that hex value to decimal?

Tags:

Microsoft, Powershell, 1.0, Convert Hex to Decimal

I am attempting to use Powershell to search a text file that contains output of registry REG_DWORD values that are in HEX.  I can find the values, now I just need to convert those values to decimal and pipe them to a new file.

The pattern is 'REG_WORD  xxxxxxxx' where xxxxxxxx is the hex value.  The catch is, the hex value does not include preceding zeros.  So, for example, the value may be hex 451 which is 1105 in decimal.

Haven't posted in awhile, so if more info is needed, I can provide.  Thanks in advance for the help.  This will be part of a powershell script, but is not dependent on the rest of the script.
Top Expert: BSonPosh
Expert Since: 08/21/2007
Accepted Solutions: 423
Computer Expertise: Advanced
BSonPosh has been an Expert for 1 year 4 months, during which he has posted 1977 comments and answered 423 questions. BSonPosh is just one of 49 experts in the MSH/Monad PowerShell Zone.
 
 
 
 
20081119-EE-VQP-47 / EE_QW_2_20070628