csplit: Splitting a text file into individual files according to a certain pattern
Oct 4, 2021 14:15 · 58 words · 1 minute read
|
|
<REGEX_PATTERN>
can e.g. be /^From:/
(e.g. when having a text file that consists of multiple emails). {*}
stands for “Repeat this split forever (in constrast to e.g. just splitting the file for the first x times).
Learn more on the respective explainshell.com output.
Some more concrete examples for csplit
usage: https://www.golinuxcloud.com/csplit-split-command-examples-linux-unix/#2_csplit_based_on_pattern_match
- You are in control
- My Favorite Shortcuts for VS Code
- Customizing my shell: From bash to zsh to fish
- JSON5: JSON with comments (and more!)
- jq: Analyzing JSON data on the command line
- Get Total Directory Size via Command Line
- Changing DNS server for Huawei LTE router
- Notes on Job & Career Development
- Adding full-text search to a static site (= no backend needed)
- Generating a random string on Linux & macOS