viewRaw: View the Raw Binary Content of a File

Description Usage Arguments Details Author(s) See Also Examples

View source: R/viewRaw.R

Description

Displays the raw bytes of a file like a hex editor, showing offsets within the file, raw bytes in binary or hexadecimal form, and a human-readable representation of the bytes as either ASCII characters, integers, or real values.

Usage

1

Arguments

...

Arguments passed to the function readRaw.

page

If TRUE, the output is sent to the application set up to display text files as per getOption("pager").

Details

This function is only called for its side-effect, which is to display the file.

Author(s)

Paul Murrell

See Also

readRaw viewFormat

Examples

1
2
3
4
5
6
7
8
9
viewRaw(hexViewFile("rawTest.txt"), width=8)
viewRaw(hexViewFile("rawTest.txt"), machine="binary", width=4)

# UNICODE text
# rawTest.unicode created using Notepad on Windows
viewRaw(hexViewFile("rawTest.unicode"), width=8)

viewRaw(hexViewFile("rawTest.int"), human="int")
viewRaw(hexViewFile("rawTest.real"), human="real", width=8, endian="big")

Example output

0  :  74 65 73 74 20 70 61 74  |  test pat
8  :  74 65 72 6e 0a           |  tern.    
 0  :  01110100 01100101 01110011 01110100  |  test
 4  :  00100000 01110000 01100001 01110100  |   pat
 8  :  01110100 01100101 01110010 01101110  |  tern
12  :  00001010                             |  .    
 0  :  ff fe 74 00 65 00 73 00  |  ..t.e.s.
 8  :  74 00 20 00 70 00 61 00  |  t. .p.a.
16  :  74 00 74 00 65 00 72 00  |  t.t.e.r.
24  :  6e 00 0d 00 0a 00        |  n.....   
  0  :  01 00 00 00 02 00 00 00 03 00 00 00 04 00 00 00  |   1  2  3  4
 16  :  05 00 00 00 06 00 00 00 07 00 00 00 08 00 00 00  |   5  6  7  8
 32  :  09 00 00 00 0a 00 00 00 0b 00 00 00 0c 00 00 00  |   9 10 11 12
 48  :  0d 00 00 00 0e 00 00 00 0f 00 00 00 10 00 00 00  |  13 14 15 16
 64  :  11 00 00 00 12 00 00 00 13 00 00 00 14 00 00 00  |  17 18 19 20
 80  :  15 00 00 00 16 00 00 00 17 00 00 00 18 00 00 00  |  21 22 23 24
 96  :  19 00 00 00 1a 00 00 00 1b 00 00 00 1c 00 00 00  |  25 26 27 28
112  :  1d 00 00 00 1e 00 00 00 1f 00 00 00 20 00 00 00  |  29 30 31 32
128  :  21 00 00 00 22 00 00 00 23 00 00 00 24 00 00 00  |  33 34 35 36
144  :  25 00 00 00 26 00 00 00 27 00 00 00 28 00 00 00  |  37 38 39 40
160  :  29 00 00 00 2a 00 00 00 2b 00 00 00 2c 00 00 00  |  41 42 43 44
176  :  2d 00 00 00 2e 00 00 00 2f 00 00 00 30 00 00 00  |  45 46 47 48
192  :  31 00 00 00 32 00 00 00                          |  49 50       
  0  :  3f 94 7a e1 47 ae 14 7b  |  0.02
  8  :  3f a4 7a e1 47 ae 14 7b  |  0.04
 16  :  3f ae b8 51 eb 85 1e b8  |  0.06
 24  :  3f b4 7a e1 47 ae 14 7b  |  0.08
 32  :  3f b9 99 99 99 99 99 9a  |  0.10
 40  :  3f be b8 51 eb 85 1e b8  |  0.12
 48  :  3f c1 eb 85 1e b8 51 ec  |  0.14
 56  :  3f c4 7a e1 47 ae 14 7b  |  0.16
 64  :  3f c7 0a 3d 70 a3 d7 0a  |  0.18
 72  :  3f c9 99 99 99 99 99 9a  |  0.20
 80  :  3f cc 28 f5 c2 8f 5c 29  |  0.22
 88  :  3f ce b8 51 eb 85 1e b8  |  0.24
 96  :  3f d0 a3 d7 0a 3d 70 a4  |  0.26
104  :  3f d1 eb 85 1e b8 51 ec  |  0.28
112  :  3f d3 33 33 33 33 33 33  |  0.30
120  :  3f d4 7a e1 47 ae 14 7b  |  0.32
128  :  3f d5 c2 8f 5c 28 f5 c3  |  0.34
136  :  3f d7 0a 3d 70 a3 d7 0a  |  0.36
144  :  3f d8 51 eb 85 1e b8 52  |  0.38
152  :  3f d9 99 99 99 99 99 9a  |  0.40
160  :  3f da e1 47 ae 14 7a e1  |  0.42
168  :  3f dc 28 f5 c2 8f 5c 29  |  0.44
176  :  3f dd 70 a3 d7 0a 3d 71  |  0.46
184  :  3f de b8 51 eb 85 1e b8  |  0.48
192  :  3f e0 00 00 00 00 00 00  |  0.50
200  :  3f e0 a3 d7 0a 3d 70 a4  |  0.52
208  :  3f e1 47 ae 14 7a e1 48  |  0.54
216  :  3f e1 eb 85 1e b8 51 ec  |  0.56
224  :  3f e2 8f 5c 28 f5 c2 8f  |  0.58
232  :  3f e3 33 33 33 33 33 33  |  0.60
240  :  3f e3 d7 0a 3d 70 a3 d7  |  0.62
248  :  3f e4 7a e1 47 ae 14 7b  |  0.64
256  :  3f e5 1e b8 51 eb 85 1f  |  0.66
264  :  3f e5 c2 8f 5c 28 f5 c3  |  0.68
272  :  3f e6 66 66 66 66 66 66  |  0.70
280  :  3f e7 0a 3d 70 a3 d7 0a  |  0.72
288  :  3f e7 ae 14 7a e1 47 ae  |  0.74
296  :  3f e8 51 eb 85 1e b8 52  |  0.76
304  :  3f e8 f5 c2 8f 5c 28 f6  |  0.78
312  :  3f e9 99 99 99 99 99 9a  |  0.80
320  :  3f ea 3d 70 a3 d7 0a 3d  |  0.82
328  :  3f ea e1 47 ae 14 7a e1  |  0.84
336  :  3f eb 85 1e b8 51 eb 85  |  0.86
344  :  3f ec 28 f5 c2 8f 5c 29  |  0.88
352  :  3f ec cc cc cc cc cc cd  |  0.90
360  :  3f ed 70 a3 d7 0a 3d 71  |  0.92
368  :  3f ee 14 7a e1 47 ae 14  |  0.94
376  :  3f ee b8 51 eb 85 1e b8  |  0.96
384  :  3f ef 5c 28 f5 c2 8f 5c  |  0.98
392  :  3f f0 00 00 00 00 00 00  |  1.00 

hexView documentation built on May 2, 2019, 7:02 a.m.