1
0
Fork
You've already forked splitgrep
0
Split a file into blocks and filter blocks based on regular expressions
  • C++ 86.8%
  • Makefile 13.2%
2026年05月20日 02:08:38 +02:00
include Initial commit 2026年05月20日 02:08:38 +02:00
src Initial commit 2026年05月20日 02:08:38 +02:00
.gitignore Initial commit 2026年05月20日 02:08:38 +02:00
LICENSE Initial commit 2026年05月20日 18:08:07 +02:00
Makefile Initial commit 2026年05月20日 02:08:38 +02:00
README.md Initial commit 2026年05月20日 02:08:38 +02:00

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.