Stata 15 help for hexdump

[D] hexdump -- Display hexadecimal report on file

Syntax

hexdump filename [, options]

options Description ------------------------------------------------------------------------- analyze display a report on the dump rather than the dump itself tabulate display a full tabulation of the ASCII and extended ASCII characters in the analyze report noextended do not display printable extended ASCII characters results store results containing the frequency with which each character code was observed; programmer's option from(#) dump or analyze first byte of the file; default is to start at first byte, from(0) to(#) dump or analyze last byte of the file; default is to continue to the end of the file -------------------------------------------------------------------------

Description

hexdump displays a hexadecimal dump of a file or, optionally, a report analyzing the dump.

Options

analyze specifies that a report on the dump, rather than the dump itself, be presented.

tabulate specifies in the analyze report that a full tabulation of the ASCII and extended ASCII characters also be presented.

noextended specifies that hexdump not display printable extended ASCII characters, characters in the range 161-254 or, equivalently, 0xa1-0xfe. (hexdump does not display characters 128-160 and 255.)

results is for programmers. It specifies that, in addition to other stored results, hexdump store r(c0), r(c1), ..., r(c255), containing the frequency with which each character code was observed.

from(#) specifies the first byte of the file to be dumped or analyzed. The default is to start at the first byte of the file, from(0).

to(#) specifies the last byte of the file to be dumped or analyzed. The default is to continue to the end of the file.

The ASCII table

+-----------------------------------------------------------------------+ | | we also | | | | write written | | | Category | Decimal Hex as as | Description | |-----------+----------------------------------+------------------------| | Control | 000 00 \0 NUL | null | | Codes | 001 01 ^A SOH | start of heading | | | 002 02 ^B STX | start of text | | | 003 03 ^C ETX | end of text | | | 004 04 ^D EOT | end of transmission | | | 005 05 ^E ENQ | enquiry | | | 006 06 ^F ACK | acknowledge | | | 007 07 ^G BEL | bell | | | 008 08 ^H BS | backspace | | | 009 09 \t HT ^I | horizontal tab | | | 010 0a \n LF ^J | line feed, newline | | | 011 0b ^K VT | vertical tabulation | | | 012 0c ^L FF | form feed | | | 013 0d \r CR ^M | carriage return | | | 014 0e ^N SO | shift out | | | 015 0f ^O SI | shift in | | | 016 10 ^P DLE | data link escape | | | 017 11 ^Q DC1 XON | device control 1 | | | 018 12 ^R DC2 | device control 2 | | | 019 13 ^S DC3 XOFF | device control 3 | | | 020 14 ^T DC4 | device control 4 | | | 021 15 ^U NAK | negative acknowledge | | | 022 16 ^V SYN | synchronous idle | | | 023 17 ^W ETB | end transmission block | | | 024 18 ^X CAN | cancel | | | 025 19 ^Y EM | end of medium | | | 026 1a ^Z SUB | substitute | | | 027 1b Esc ESC ^[ | escape | | | 028 1c 28 FS ^\ | file separator | | | 029 1d 29 GS ^] | group separator | | | 030 1e 30 RS ^^ | record separator | | | 031 1f 31 US ^_ | unit separator | |-----------+----------------------------------+------------------------| | ASCII | 032 20 blank SP | space | | printable | 033 21 ! | exclamation point | | | 034 22 " | quotation mark | | | 035 23 # | number sign | | | 036 24 $ | dollar sign | | | 037 25 % | percent sign | | | 038 26 & | ampersand | | | 039 27 ' | apostrophe | | | 040 28 ( | opening parenthesis | | | 041 29 ) | closing parenthesis | | | 042 2a ) | closing parenthesis | | | 043 2b + | plus | | | 044 2c , | comma | | | 045 2d - | hyphen | +-----------------------------------------------------------------------+

Examples

. hexdump myfile.raw

. hexdump myfile.raw, analyze

Stored results

hexdump, analyze and hexdump, results store the following in r():

Scalars r(Windows) number of \r\n r(Mac) number of \r by itself r(Unix) number of \n by itself r(blank) number of blanks r(tab) number of tab characters r(comma) number of comma (,) characters r(ctl) number of binary 0s; A-Z, excluding \r, \n, \t; DELs; and 128-159, 255 r(uc) number of A-Z r(lc) number of a-z r(digit) number of 0-9 r(special) number of printable special characters (!@#, etc.) r(extended) number of printable extended characters (160-254) r(filesize) number of characters r(lmin) minimum line length r(lmax) maximum line length r(lnum) number of lines r(eoleof) 1 if EOL at EOF, 0 otherwise r(l1) length of 1st line r(l2) length of 2nd line r(l3) length of 3rd line r(l4) length of 4th line r(l5) length of 5th line r(c0) number of binary 0s (results only) r(c1) number of binary 1s (^A) (results only) r(c2) number of binary 2s (^B) (results only) ... ... r(c255) number of binary 255s (results only)

Macros r(format) ASCII, EXTENDED ASCII, or BINARY


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index