Sponsored Content
Top Forums Shell Programming and Scripting Covert Deci to Hex (New to AWK) Post 70882 by Linda_H on Wednesday 4th of May 2005 11:29:55 PM
Old 05-05-2005
Hi ZB,

Thanks very much for the help. I realised that you are using "sed" command, but can i do it in awk? and I am running the prog in UNIX.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

AWK and hex sequences

for file in `seq 1 256`; do printf "\x$file -- $file" ; done ; printf "\n" produces the wrong output. I want to show the ascii codes but need to output a hexidecimal number sequence. I know I should use awk to do this but i'm not sure how cause I forget. what is the awk equivelant of seq... (5 Replies)
Discussion started by: JoeTheGuy
5 Replies

2. Programming

After converting the hexstr to Hex and storing the Hex in a char*

Hi All, My main intension of is to convert the Hexstring stored in a char* into hex and then prefixing it with "0x" and suffix it with ',' This has to be done for all the hexstring char* is NULL. Store the result prefixed with "0x" and suffixed with ',' in another char* and pass it to... (1 Reply)
Discussion started by: rvan
1 Replies

3. Programming

What is the difference between ios::hex and std::hex?

Hi, Is there really a difference between these two, std::hex and ios::hex?? I stumbled upon reading a line, "std::ios::hex is a bitmask (8 on gcc) and works with setf(). std::hex is the operator". Is this true? Thanks (0 Replies)
Discussion started by: royalibrahim
0 Replies

4. Shell Programming and Scripting

awk to remove leading zeros for a hex number

Is it possible by using awk to remove leading zeros for a hex number? ex: 0000000011179E0A -> 11179E0A Thank you! (4 Replies)
Discussion started by: carloszhang
4 Replies

5. UNIX for Dummies Questions & Answers

How to specify a FS as HEX value in AWK

Hi All, I have one input file seperated with Hex decimal B1 value. And i want to process this file. And iam creating an awk script to process this file. How can I specify the Field seperator as HEX B1 in my awk. Please help. Thanks in advance.:) (2 Replies)
Discussion started by: psk_kumar
2 Replies

6. Shell Programming and Scripting

Range of numbers in HEX using AWK

Hi , How do i found out all the number in a range ( HEX) for example Input is 15CF:15D2 Output needed 15CF 15D0 15D1 15D2 Thanks (2 Replies)
Discussion started by: greycells
2 Replies

7. Shell Programming and Scripting

how to get data from hex file using SED or AWK based on pattern sign

I have a binary (hex) file I need to parse to get some data which are encoded this way: .* b4 . . . 01 12 .* af .* 83 L1 x1 x2 xL 84 L2 y1 y2 yL By another words there is a stream of hexadecimal bytes (in my example separated by space for better readability). I need to get value stored in... (3 Replies)
Discussion started by: sameucho
3 Replies

8. Shell Programming and Scripting

awk to compare hex number

$ awk 'BEGIN{ pat111=0x1000000002E3E02; snBegin=0x1000000002E3E01; if (pat111<=snBegin) printf "a\n"}' a Result is not correct. Looks like the number is too big. Any idea? Thx! Please use code tags <- click the link! (2 Replies)
Discussion started by: carloszhang
2 Replies

9. HP-UX

Replacing Hex Characters In A File Using awk?

Hi guys, First off, i'm a complete noob to UNIX and LINUX so apologies if I don't understand the basics! I have a file which contains a hex value of '0D' at the end of each line when I look at it in a hex viewer. I need to change it so it contains a hex value of '0D0A0A' I thought... (10 Replies)
Discussion started by: AndyBSG
10 Replies

10. Shell Programming and Scripting

Print hex Ip address in decimal format inside awk script

Hi to all, May someone help me with the following. The awk script below is part of a bigger awk script, and this part attempts to print an Ip address that is in hex format in decimal format. I'm trying with following code but I'm getting 0.0.0.0 and the correct answer is 192.168.140.100 ... (9 Replies)
Discussion started by: Ophiuchus
9 Replies
TXT2REGEX(1)						      General Commands Manual						      TXT2REGEX(1)

NAME
txt2regex - a Regular Expression Wizard, written with bash2 builtins SYNOPSIS
txt2regex txt2regex --nocolor|--whitebg txt2regex --all|--prog <p1,p2,...,pN> txt2regex --showmeta|--showinfo <program> txt2regex --make <target> txt2regex --history <value> DESCRIPTION
txt2regex is a Regular Expression "wizard", all written with bash2 builtins, that converts human sentences to regexes. With a simple interactive interface, you just answer to questions and build your own regex for a large variety of programs, like awk, emacs, grep, perl, php, procmail, python, sed and vim. There are more than 20 supported programs. It's bash so download and run, no compilation needed. Please visit the program homepage at http://txt2regex.sf.net. OPTIONS
--all works with all registered programs --help prints the help message and quit --history <value> prints to STDOUT a regex from a history data --make <target> prints a ready regex for a common pattern --nocolor self-explanatory --prog <p1,p2,...> choose which programs to use (separated by commas) --showinfo <program> prints regex info about the program --showmeta prints a complete metachar table for all programs --version prints the program version and quit --whitebg colors adjusted to white background terminals By default, all options are turned OFF. Just call it with no options to launch the default interactive interface. DETAILS
--all is cool but requires lots of lines (~35) --nocolor is strong, so it kills --whitebg --showmeta rules, try it --showinfo uses reverse video output, --nocolor turns it off --history is getting useful, stay tunned --make is a remedy for headaches --prog is nice to use your favorite programs, mix it with --make and --history EXAMPLES
Calling the program on the default interactive interface $ txt2regex Calling the program on a white terminal $ xterm -fg black -bg white ; txt2regex --whitebg Getting information $ txt2regex --showmeta Getting specific information $ txt2regex --showinfo sed Calling it for specific programs $ txt2regex --prog vim,sed,grep,python Applying a history data $ txt2regex --history '16421x:01x:' Getting ready regexes! $ txt2regex --make hour $ txt2regex --make number3 --prog perl $ txt2regex --make date2 --all INTERFACE
The program interface is simple and easy to use. This is its contents: +---------------------------------------+ | -> Top menu | | -> Group menu | | | | -> Regexes of the programs selected | | ... | | ... | | | | -> History | | -> Your prompt | | | | -> The question | | -> The answers | | ... | | ... | +---------------------------------------+ All the basic commands can be used on the numeric pad on the keyboard, but remember to turn ON the NumLock key. Command Description . Quit the program (with confirmation) 0 Reset the Regular Expression 1-9 Answers the questions * Toggles color ON/OFF / Add/remove programs on/from the list | Insert an alternation (where allowed) ( Open a new group (where allowed) ) Close the opened group (if any) BUGS
Bug reports and contributions are VERY welcome! Please send them to the author. AUTHOR
Written and maintained by Aurelio Marinho Jargas <verde@aurelio.net> COPYRIGHT
Copyright (C) 2000, 2001, 2002, 2003, 2004 Aurelio Marinho Jargas This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICU- LAR PURPOSE. September, 28th - 2004 TXT2REGEX(1)
All times are GMT -4. The time now is 02:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy