At 06:23 -0700 6/1/06, Kenneth Prager wrote: >I am receiving some status reports with numbers that are in hex format. I was >planning to use BBEdit to reformat the report to make it more readable and >would like to convert the hex numbers to decimal using BBEdit, rather than >writing an external program.
perl supports a hex($astring) function that will convert a string of hex characters to decimal. If you can reliably extract such a string using a regular expression with capture parentheses it might work. You could probably call hex($1) from within a substitution expression using a modifier that I would have to look up. q comes to mind. But. . . be sure you know where the stuff comes from especially if there are more than two hex characters in a row. In the dyslexic world of DEC and Intel it is common practice to place the most significant pair of hex characters to the right of a pair of less significance. Assembly listings were ALL that way in times of old when people actually read those things. -- --> The message came to Abraham that he would beget a son. Sarah, who was behind the door, laughed. <-- -- ------------------------------------------------------------------ Have a feature request? Not sure the software's working correctly? If so, please send mail to <[EMAIL PROTECTED]>, not to the list. List FAQ: <http://www.barebones.com/support/lists/bbedit_talk.shtml> List archives: <http://www.listsearch.com/BBEditTalk.lasso> To unsubscribe, send mail to: <[EMAIL PROTECTED]>
