Read hex data into less
Asked Answered
P

1

0

I want to give a big data file to less -s -M +Gg such that read current given data in less -s -M +Gg.

While-loop example (see ntc2's answer)

Less command explained here. Replacing the yes by a binary file which is converted to binary ascii and hex:

while read -u 10 p || [[ -n $p ]]; do
    hexdump -e '/4 "%08x\n"' {$p}                       \
                                                        \
    | less -s -M +Gg
done 10</Users/masi/Dropbox/7-8\:2015/r3.raw

where the looping is based on this thread here.

How can you read such data into less?

Pileus answered 24/6, 2015 at 13:19 Comment(0)
R
2

I don't understand the details of the example, but I think you want to put the less outside of the loop, like this:

while read -u 10 p || [[ -n $p ]]; do
    hexdump -e '/4 "%08x\n"' {$p}
done 10</Users/masi/Dropbox/7-8\:2015/r3.raw | less -s -M +Gg
Racket answered 24/6, 2015 at 18:32 Comment(1)
Thank you for your answer! I had to accept it and simplify the case even further here https://mcmap.net/q/589960/-screen-big-data-without-interrupting-data-conversion/54964Deedradeeds

© 2022 - 2024 — McMap. All rights reserved.