Split a file into blocks and filter blocks based on regular expressions
| include | Initial commit | |
| src | Initial commit | |
| .gitignore | Initial commit | |
| LICENSE | Initial commit | |
| Makefile | Initial commit | |
| README.md | Initial commit | |
splitgrep
A little command line utility the splits a file into blocks based on a regular expression, matches each block against the provided regular expressions and writes the matching blocks to stdout.
# 2026年05月04日 w19
- Deadline conference paper
# 2026年05月04日 w19 Mon
- Pentecoste
# 2026年05月05日 w19 Tue +office
- 8:30-9 Weekstart
- 10:00 Ted room A3021
- 13-16 Teach - Multilevel modelling
# 2026年05月06日 w19 Wed +office
- Call Francisca
- 13-16 Teach - Multilevel modelling
- 19:30 Daughter hockey training
# 2026年05月07日 w19 Thu +office
# 2026年05月08日 w19 Fri
# 2026年05月09日 w19 Sat
- 11:15 Travel hockey; pickup Alice
- 12:15 Hockey match
- 17:00 Eat out
# 2026年05月10日 w19 Sun
- 9:00 Run
For example, to check which days I have to teach:
$ splitgrep --file=calendar.md "Teach"
# 2026年05月05日 w19 Tue +office
- 8:30-9 Weekstart
- 10:00 Ted room A3021
- 13-16 Teach - Multilevel modelling
# 2026年05月06日 w19 Wed +office
- Call Francisca
- 13-16 Teach - Multilevel modelling
- 19:30 Daughter hockey training
Or, when the hockey matches are.
$ splitgrep --file=calendar.md " Sat" "Hockey"
# 2026年05月09日 w19 Sat
- 11:15 Travel hockey; pickup Alice
- 12:15 Hockey match
- 17:00 Eat out
Building
Requirements
- C++ compiler support C++20
make
To build run
make
This should result in the binary splitgrep. To install copy this file to
whereever you keep your binaries.