sharkdp / hexyl

A command-line hex viewer
Apache License 2.0
8.92k stars 227 forks source link

Feature Request: Specify length for displaying output #157

Closed figgis closed 1 year ago

figgis commented 2 years ago

I have some small binary masks, size 20x12 that I can display in my terminal using e.g hexdump:

❯ hexdump -v -e '20/1 " %02X" "\n"' mask_20x12.y
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF FF 00 00 00 FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF 00 00 00 00 FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF 00 00 00 00 FF FF FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF 00 00 00 00 00 00 FF FF FF FF FF FF
 FF FF FF FF FF FF FF FF 00 00 00 00 00 00 00 FF FF FF FF FF
 FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 FF FF FF FF FF
 FF FF FF FF FF FF FF 00 00 00 00 00 00 00 00 FF FF FF FF FF

It would be wonderful if hexyl had the same capability.

sharkdp commented 2 years ago

I'm sorry, but I'm not familiar with that hexdump option (-e/--format). Can you please tell us more?

sharkdp commented 2 years ago

Is this a duplicate of #13?

triallax commented 2 years ago

I'm sorry, but I'm not familiar with that hexdump option (-e/--format). Can you please tell us more?

This should help: https://www.man7.org/linux/man-pages/man1/hexdump.1.html#FORMATS

sharkdp commented 1 year ago

I'm closing this due to inactivity. Please feel free to comment in case it should be re-opened.

figgis commented 1 year ago

inactivity - well, yes. Also just a feature request with a well specified output and an example how hexdump allows you to specify the width. Not much to comment on :)

sharkdp commented 1 year ago

Well... I was asking above if this is a duplicate of #13 and never received an answer.

figgis commented 1 year ago

My bad. Looks indeed like a duplicate of #13. I'm so sorry for waisting your time :) Apologies!