[Question]
  [
# Code Golf Measurer © 2019
Hexdumps used with `xxd` look something like this:
```
00000000: 666f 6f20 6261 7220 7370 616d 2065 6767  foo bar spam egg
00000010: 730a                                     s.
```
Your task is to convert a hexdump in this form in to the number of bytes used.
## Rules:
* Usual loopholes forbidden.
* This is [code-golf](/questions/tagged/code-golf "show questions tagged 'code-golf'"), so shortest valid answer in bytes wins.
* You may or may not include the newline at the end of text (`0a`). This means that if the hexdump ends in a newline (`0a`), that input may have it's output reduced by one.
* An empty input (literally nothing: empty list/string/etc.) must output 0.
* Input can be taken in any form
* Input will be valid ASCII with no control characters
* The input must contain the whole hexdump
## Test cases:
```
00000000: 4865 6c6c 6f2c 2077 6f72 6c64 2120 4865  Hello, world! He
00000010: 6c6c 6f2c 2077 6f72 6c64 210a            llo, world!.
```
returns 28 or 27
```
00000000: 0a                                       .
```
returns 1 or 0
```
00000000: 6368 616c 6c65 6e67 650a                 challenge.
```
returns 10 or 9
```
00000000: 4865 6c6c 6f2c 2077 6f72 6c64 21         Hello, world!
```
returns 13
```
```
returns 0 *(This is literally nothing: empty list/string/etc.)*
Explanations would be nice for non-standard languages.
  
[Answer]
# [tcsh](http://www.tcsh.org/), 12 bytes
```
xxd -r|wc -c
```
[Try it online!](https://tio.run/##K0kuzvj/v6IiRUG3qKY8WUE3@f9/AyiwUjAzNrNQMDM0S1YwSzYzVTBLNTNXMDM1SFRAB8kZiTk5qXnpqXoA "tcsh – Try It Online")
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), 8 bytes
```
.{51}
.
```
[Try it online!](https://tio.run/##K0otycxL/P9fr9rUsJaLS@//fwMosFIwsTAzVTBLNktWMEszSlYwMjA3B7LMjUBiJgpGhkYGECUKHqk5Ofk6CuX5RTkpikAeF8QEQ6AZeLQbJCogASQT9AA "Retina 0.8.2 – Try It Online") Explanation:
```
.{51}
```
Delete the first 51 characters of each line. (Lines can only have between 52 and 67 characters, so this always matches once per line.)
```
.
```
Count the remaining non-newline characters.
7 bytes if empty input did not have to be supported:
```
.{52}
```
[Try it online!](https://tio.run/##K0otycxL/P9fr9rUqJaL6/9/AyiwUjCxMDNVMEs2S1YwSzNKVjAyMDcHssyNQGImCkaGRgYQJQoeqTk5@ToK5flFOSmKQB4XxARDoBl4tBskKiABJBP0AA "Retina 0.8.2 – Try It Online") Explanation:
```
.{52}
```
Delete the first 52 characters of each line. (Lines can only have between 52 and 67 characters, so this always matches once per line.)
```
```
Count 1 more than the number of remaining characters (including newlines).
[Answer]
# [V (vim)](https://github.com/DJMcMayhem/V), 7 bytes
```
Î51x
Ø.
```
[Try it online!](https://tio.run/##K/v//3CfqWEF1@EZev//G0CBlYKJhZmpglmyWbKCWZpRsoKRgbk5kGVuBBIzUTAyNDKAKFHwSM3JyddRKM8vyklRBPK4ICYYAs3Ao90gUQEJIJmgBwA "V (vim) – Try It Online")
Explanation:
```
Î       " On every line...
 51x    "   Delete the first 51 characters
Ø.      " Count the number of remaining characters on any line
```
Hexdump:
```
00000000: ce35 3178 0dd8 2e                        .51x...
```
[Answer]
# [Retina](https://github.com/m-ender/retina/wiki/The-Language), 7 bytes
This counts the total number of single-line strings of length 52. It might be possible to do something similar to `%52,`.`, but I failed to find a way to fix that.
```
w`.{52}
```
[Try it online!](https://tio.run/##K0otycxLNPz/vzxBr9rUqPb/fwMosFIwsTAzVTBLNktWMEszSlYwMjA3B7LMjUBiJgpGhgow4JGak5Ovo1CeX5STosgFAA "Retina – Try It Online")
[Answer]
# [APL (Dyalog Extended)](https://github.com/abrudz/dyalog-apl-extended), 18 bytes
Full program. Prompts for list of strings (i.e. of lists of characters).
```
2÷⍨≢∊(1↓≠⊆⊢)¨49↑¨⎕
```
[Try it online!](https://tio.run/##SyzI0U2pTMzJT9dNrShJzUtJTfn/qKO94L/R4e2Pelc86lz0qKNLw/BR2@RHnQsedbU96lqkeWiFieWjtomHVjzqmwpS/F8BDAq41A2gwErBxMLMVMEs2SxZwSzNKFnByMDcHMgyNwKJmSgYGRoZQJQoeKTm5OTrKJTnF@WkKAJ56gpQUwyBpuAxwCBRAQkgmaGnzgVzz6OuJiQnoerAA3CaYGZsZqFgZghyUzLIe6lmQDeZYjE3OSMxJyc1Lz0Vp1GEwgduFEr4IEwzeNS7BWSiOgA "APL (Dyalog Extended) – Try It Online")
`⎕` prompt
`49↑¨` take the first 49 characters from each
`(`…`)¨` apply the following tacit function to each:
 `⊢` the argument
 `⊆` chop into runs of characters that are
 `≠` different from the padding character (space)
 `1↓` drop the first "word"
`∊` **ϵ**nlist (flatten)
`≢` tally
`2÷⍨` divide by two
[Answer]
# [C (gcc)](https://gcc.gnu.org/), ~~64~~ ~~55~~ ~~45~~ 39 bytes
```
s[];f(l){l=gets(s)?strlen(s)-51+f():0;}
```
[Try it online!](https://tio.run/##fYy9DoIwHMRn@xR/MSZtBFIaKAb8WH0HdSCFYpNaDK1xIDw71uDg5E13l7ufiFohpsmer6XEmgx63zbOYkuO1vW6Md5FWbKRmBS0HKeVMkI/6wZ21tWqi28HhJRxcK@UwQQGtHj0PkscrOuLCULwR1KicaJfFZBueQZccAFcMgGM5rl3Oft0KbCE0XkCp0brLoRX1@t66ROaCYln/LnTCn70Q4jf "C (gcc) – Try It Online")
9 bytes shaved off thanks to YSC, 10 thanks to jdt, and 6 thanks to c--!
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 5 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
```
Ẉ_51S
```
A monadic Link accepting a list of lines which yield the integer byte count.
**[Try it online!](https://tio.run/##y0rNyan8///hro54U8Pg////R6sbQIGVgpmZWZqCWZqRgYKZkZmhgrkRkGVubA7kGpqlKBgZmJkqmJmbmSsopOXnKyQlFikUFyTmKqSmp6tz6UCNMQQaY25skKhADCjWU48FAA "Jelly – Try It Online")**
### How?
```
Ẉ_51S - Link: list of lists of characters, H
Ẉ     - length of each (line in H)
  51  - literal fifty-one
 _    - subtract (vectorises)
    S - sum
```
[Answer]
# Python 3, 48 46 bytes
```
lambda s:(len(s)or 51)+1-52*len(s.split('\n'))
```
Input is passed as a string to the function. The function increments the length of the input (including newlines), then subtracts 52 for each line.
[Try it online](https://tio.run/##K6gsycjPM/6fZhvzPycxNyklUaHYSiMnNU@jWDO/SMHUUFPbUNfUSAssoldckJNZoqEek6euqfm/oCgzr0QjTUMdDIACAA)
[Answer]
# [Japt](https://github.com/ETHproductions/japt) [`-x`](https://codegolf.meta.stackexchange.com/a/14339/), 5 [bytes](https://en.wikipedia.org/wiki/ISO/IEC_8859-1)
Input as an array of lines.
```
®Ê-51
```
[Try it](https://petershaggynoble.github.io/Japt-Interpreter/?v=1.4.6&flags=LXg&code=rsotNTE&input=WyIwMDAwMDAwMDogNDg2NSA2YzZjIDZmMmMgMjA3NyA2ZjcyIDZjNjQgMjEyMCA0ODY1ICBIZWxsbywgd29ybGQhIEhlIiwiMDAwMDAwMTA6IDZjNmMgNmYyYyAyMDc3IDZmNzIgNmM2NCAyMTBhICAgICAgICAgICAgbGxvLCB3b3JsZCEuIl0)
```
®Ê-51     :Implicit input of array
®         :Map
 Ê        :  Length
  -51     :  Subtract 51
          :Implicit output of sum of resulting array
```
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), 18 bytes
```
{.join.comb-51*$_}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYPu/Wi8rPzNPLzk/N0nX1FBLJb72vzVXcWKlQpqCg0ZOZl5qseZ/AyiwUjCxMDNVMEs2S1YwSzNKVjAyMDcHssyNQGImCkaGRgYQJQoeqTk5@ToK5flFOSmKQB4XxARDoBl4tBskKiABJBP0AA "Perl 6 – Try It Online")
Anonymous Whatever lambda that takes a list of lines and returns the sum of the number of characters, subtracting 51 for each line
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), ~~8~~ 6 bytes
```
€g51-O
```
[Try it online!](https://tio.run/##yy9OTMpM/f//UdOadFNDXf///6OVDKDASsHEwsxUwSzZLFnBLM0oWcHIwNwcyDI3AomZKBgZGhlAlCh4pObk5OsolOcX5aQoAnlKOlBTDIGm4DHAIFEBCSCZoacUCwA "05AB1E – Try It Online")
Input as a list of strings.
```
€g     get lengths of each line
51-    subtract 51 from each
O      push the sum of the resulting list
       implicitly print
```
[Answer]
# IBM/Lotus Notes Formula Language, 53 bytes
```
@Sum(@Length(@Explode(@Right(@Left(i;"  ");": ")))/2)
```
There is no TIO for Formula so here are screenshots of the test cases:
[![enter image description here](https://i.stack.imgur.com/aWsyt.png)](https://i.stack.imgur.com/aWsyt.png)
[![enter image description here](https://i.stack.imgur.com/GDpSY.png)](https://i.stack.imgur.com/GDpSY.png)
[![enter image description here](https://i.stack.imgur.com/lt6DE.png)](https://i.stack.imgur.com/lt6DE.png)
[![enter image description here](https://i.stack.imgur.com/NhurB.png)](https://i.stack.imgur.com/NhurB.png)
[![enter image description here](https://i.stack.imgur.com/MFXe0.png)](https://i.stack.imgur.com/MFXe0.png)
The formula is in the computed field that provides the value after "Returns".
**Explanation**
This is a good demonstration of the way that Formula will recursively apply a function to a list without needing a loop. The formula is in a computed field on the same form as editable input field `i'.
1. Start in the middle. `@Left` and `@Right` allow a string delimiter or a number of characters to be used. We therefore search to the right of `:`  and then to the left of the first occurrence of two spaces. Since Formula sees the newline as a list separator it will apply this to each line in the input.
2. `@Explode` is Formula's equivalent of a `split` function and defaults to space, `,` or `;`. Again it is applied to each line in the field but this time the results are combined into a single list.
3. `@Length` will then be applied to each member of the list. In each case we divide it's return value by 2.
4. `@Sum` the whole list and output the result.
[Answer]
# JavaScript (ES6), 34 bytes
```
s=>(n=s.length)&&(n/68<<4)+n%68-51
```
[Try it online!](https://tio.run/##hZDBDoIwEETvfMV6EEoQhApLY8CzH@GF1AKapjVA9PORRqOQKMypnbRvZ@da3IuWN5db5yt9Fn2Z921@ICpvAylU1dWubRO1RZZlseupNTI/iXquVaulCKSuSEksACd8aw8xwwSQIwcsKQcapulwSqnxYqARDV9P4Cik1Bt46EaeV8PtpBzwvqxoYM1gwgJGGpECx3Jday7h9OuMllG4QwYYmZTcrC1wSJn8GMDrQppCxTJzqcAPc1LgH6yx@yc "JavaScript (Node.js) – Try It Online")
### Commented
```
s =>                // s = input string
  (n = s.length) && // n = length of s; return 0 right away if n = 0 (special case)
  (n / 68 << 4) +   // otherwise compute the number of full lines and multiply it by 16
  n % 68 - 51       // add the length of the last line minus 51
```
[Answer]
# [Red](http://www.red-lang.org), ~~81~~ 55 bytes
```
func[s][n: 0 foreach l s[n: n - 51 + length? l]max 0 n]
```
[Try it online!](https://tio.run/##nZA/D4IwEMV3PsWT1T8pFQphcXV2bTo0pRWTWgxg9NtjG4mBRBl8093l7pd3r9XVcNIVF5EpMZi7U7wT3JUgME2rpaph0YWBwxZZgjWsdue@PsCKq3z6PSeGW3txPQx4TEaVSAuWgSmmwAxVoCTPfZXTMEtBE0reKzhqa5sNHk1rq5XvYoyUxFMWAERiogljF4vom6P5wYJ@AdieFWBJcKTCc5p5R9kXrKqlDTFpT0L0Tzof1Cydma9YDC8 "Red – Try It Online")
Takes the input as a list of strings.
[Answer]
# JavaScript, ~~33~~ 32 bytes
```
a=>a.map(x=>a=~~a+x.length-51)|a
```
[Try it Online!](https://tio.run/##fYxBDoIwFESv8mVVIjSlgdaY1LV3MC5@SkFJbQkQZWG4eq2RBStn9WYyeR0@cdTDvZ9y52sTGhVQnZA@sCdzBLUsuJ@pNa6dbnlVpG8M2rvRW0Otb0lDLglbc4TyICoQWmgQDdfAmZSRJP9uJfCCs98FzsZan8HLD7bexZZkq6WIlj8ChrDJxkGTa5qGDw)
Saved 1 byte thanks to Arnauld.
[Answer]
# [Ruby](https://www.ruby-lang.org/), ~~39~~ ~~29~~ 28 bytes
-10 bytes thanks to [south](https://codegolf.stackexchange.com/users/110888/south)  
-1 byte thanks to [Sʨɠɠan](https://codegolf.stackexchange.com/users/92689/s%ca%a8%c9%a0%c9%a0an)
```
p$<.sum{_1=~/.{52}/;$'.size}
```
[Attempt This Online!](https://ato.pxeger.com/run?1=m72kqDSpclm0km6OUuyCpaUlaboWewpUbPSKS3Or4w1t6_T1qk2NavWtVdT1ijOrUmshSqAqF9xsNoACKwUTCzNTBbNks2QFszSjZAUjA3NzIMvcCCRmomBkaGQAUaLgkZqTk6-jUJ5flJOiCORxQUwwBJqBR7tBogISQDJBD-IWAA)
[Answer]
# [Befunge-98 (FBBI)](https://github.com/catseye/FBBI), 16 bytes
```
"c- cw|r- dxx"=@
```
[Try it online!](https://tio.run/##S0pNK81LT9W1tPj/XylZVyG5vKZIVyGlokLJ1uH/fwMosFIwMzazUDAzNEtWMEs2M1UwSzUzVzAzNUhUQAfJGYk5OalAI/UA "Befunge-98 (FBBI) – Try It Online")
[Answer]
# [Stax](https://github.com/tomtheisen/stax), 5 [bytes](https://github.com/tomtheisen/stax/blob/master/docs/packed.md#packed-stax)
```
ôφß→ê
```
[Run and debug it](https://staxlang.xyz/#p=93ede11a88&i=00000000%3A+4865+6c6c+6f2c+2077+6f72+6c64+2120+4865++Hello,+world%21+He%0A00000010%3A+6c6c+6f2c+2077+6f72+6c64+210a++++++++++++llo,+world%21.%0A%0A00000000%3A+0a+++++++++++++++++++++++++++++++++++++++.%0A%0A00000000%3A+6368+616c+6c65+6e67+650a+++++++++++++++++challenge.%0A%0A00000000%3A+4865+6c6c+6f2c+2077+6f72+6c64+21+++++++++Hello,+world%21&a=1&m=1)
[Answer]
# [Zsh](https://www.zsh.org/), 36 bytes
With zsh's default flags:
```
for l (${(f)1})((c+=$#l-52))
<<<$[c]
```
[Try it online!](https://tio.run/##fY/BCsIwDIbvfYqIg7Woo61bNmTefQfxMGq7HYKDeRAUn722THCK7D@EJPz5@HO/dt5xwb3rByDgyYM7oZ6Cc7PaJ0vaFFoIVtd1cjQnLxhzkMq3dpBXWAAaNIBOG9CyLENX6rjLQSstRwscLFG/hls/0HkRJjYSVGDMnMsGJpoQMpbGIGP9xPn2zyj7vcQtVoAqJjHxJYshSfGHZ7qGyF5aGxD@BQ "Zsh – Try It Online")
`${(f)1}` splits `$1` on newlines, and discards empty lines.
The `$[ arithmetic expansion ]` guards against the empty case, when the loop never sets `$c`.
# [Zsh](https://www.zsh.org/), 28 bytes
With `-o extendedglob`:
```
<<<${#${(F)${(f)1}#?(#c52)}}
```
[Try it online!](https://tio.run/##fY/RCoIwFIbv9xQnFNwgZFs5JYTuotewuenFcJFCkfjsa8Mgi/C/@DnncM7Hf5596zQm2JVlGY9RPOIT8aYJm6IjjmTGyTQ5gno12OsA6jGorlZ1Y@wFIQ0JfesA@0JkIKSQIDSXwGme@yrnYbYHzjidV@CsjLFbuNubqTe@QzOBecbKOa1goQUhRUkIMvsnzvf@itLfS7ETBQgWksjwkhI@SfaHJ9vKGNU1yiPcCw "Zsh – Try It Online")
`(f)` Split on newlines, `${ #?(#c52)}` remove leading 52 characters, `(F)` join on newlines so that counting is characterwise instead of listwise, `${# }` count characters.
[Answer]
# [asm2bf](https://github.com/KrzysztofSzewczyk/asmbf), 135 bytes
Golfed version:
```
lbl 3
mov r2,51
lbl 1
in_ r1
dec r2
jz_ r1,4
jnz r2,1
lbl 2
in_ r1
jz_ r1,4
sub r1,10
jz_ r1,3
inc r3
jmp 2
lbl 4
out r3
```
Commented version:
```
lbl 3               ; Main loop - the kinda entry point
    mov r2, 51      ; Loop 51 times.
    lbl 1           ; Loop start.
        in_ r1      ; Read character
        dec r2      ; Decrement the loop accumulator.
        jz_ r1, 4   ; If zero was read, end.
        jnz r2, 1   ; If we still loop, loop again.
    lbl 2           ; Second loop, accumulating the result.
        in_ r1      ; Read a character.
        jz_ r1, 4   ; If character is zero, end the loop and print result.
        sub r1, 10  ; Decrement r1 by 10 for next check.
        jz_ r1, 3   ; If the character - 10 (the newline) is zero, jump to 3
        inc r3      ; Increment character read amount.
        jmp 2
lbl 4
    out r3          ; Print out the result as an ASCII character.
```
[Answer]
# [PHP](https://www.php.net), 22 bytes
```
fn()=>strlen(`xxd -r`)
```
Doesn't work on ATO unfortunatly
]