# Hledger - counting transactions

**URL:** <https://forum.plaintextaccounting.org/t/hledger-counting-transactions/870>\
**Category:** General\
**Created:** [August 29, 2026, 8:12pm UTC](https://forum.plaintextaccounting.org/t/hledger-counting-transactions/870 "2026-08-29T20:12:15Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![parseaus](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@parseaus](https://forum.plaintextaccounting.org/u/parseaus)\
**Post date:** [August 29, 2026, 8:12pm UTC](https://forum.plaintextaccounting.org/t/hledger-counting-transactions/870/1 "2026-08-29T20:12:15Z")

</div>

I want to count the amount of transactions in a few accounts. Similar to part of what hledger stats does, bit with particular accounts and a custom period. How would I go about this in the simplest possible way?

---

<div class="post-metadata">

**Author:** ![olexsmir](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/olexsmir/32/202_2.png) [@olexsmir](https://forum.plaintextaccounting.org/u/olexsmir)\
**Post date:** [August 29, 2026, 9:06pm UTC](https://forum.plaintextaccounting.org/t/hledger-counting-transactions/870/2 "2026-08-29T21:06:11Z")

</div>

I'm sure there are better ways to do it, but here's what I come up with

```auto
hledger print account:name | grep "^2026-.*" | wl -c

```

---

<div class="post-metadata">

**Author:** ![simonmic](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/simonmic/32/1_2.png) [@simonmic](https://forum.plaintextaccounting.org/u/simonmic)\
**Post date:** [August 29, 2026, 10:09pm UTC](https://forum.plaintextaccounting.org/t/hledger-counting-transactions/870/3 "2026-08-29T22:09:45Z")

</div>

```auto
hledger areg SOMEACCT date:PERIODEXPR | wc -l

```

---

<div class="post-metadata">

**Author:** ![simonmic](https://yyz1.discourse-cdn.com/flex003/user_avatar/forum.plaintextaccounting.org/simonmic/32/1_2.png) [@simonmic](https://forum.plaintextaccounting.org/u/simonmic)\
**Post date:** [August 31, 2026, 8:45pm UTC](https://forum.plaintextaccounting.org/t/hledger-counting-transactions/870/4 "2026-08-31T20:45:37Z")

</div>

Oops that overcounts by one. And there was a bug in aregister --title, now fixed in hledger main, so it would be

```auto
hledger areg --title= SOMEACCT [date:PERIODEXPR] | wc -l

```

---

<div class="post-metadata">

**Author:** ![parseaus](https://avatars.discourse-cdn.com/v4/letter/p/aca169/32.png) [@parseaus](https://forum.plaintextaccounting.org/u/parseaus)\
**Post date:** [September 2, 2026, 1:00pm UTC](https://forum.plaintextaccounting.org/t/hledger-counting-transactions/870/5 "2026-09-02T13:00:25Z")

</div>

Thank you! that did it.
