Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mange/splitfiles
Splits STDIN into files on patterns
https://github.com/mange/splitfiles
Last synced: 18 days ago
JSON representation
Splits STDIN into files on patterns
- Host: GitHub
- URL: https://github.com/mange/splitfiles
- Owner: Mange
- License: mit
- Created: 2016-06-18T20:54:47.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-06-20T07:43:21.000Z (over 8 years ago)
- Last Synced: 2023-07-12T01:08:26.459Z (over 1 year ago)
- Language: Go
- Size: 15.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: Changelog.md
- License: LICENSE.md
Awesome Lists containing this project
README
# `splitfiles`
```
usage: splitfiles []Splits STDIN into files when encountering a pattern.
The generated filenames will be printed to STDOUT. With the verbose flag, the number of
lines in each file will also be printed.The pattern can be either a list of literal characters, or a regular expression that work
line by line. The line break character is part of the line you are matching by.The output will not contain the split characters.
Flags:
--help Show context-sensitive help (also try --help-long and --help-man).
-f, --force Overwrite files instead of skipping them.
-E, --regexp Parse PATTERN as a regular expression instead of a raw string.
-v, --verbose Print number of lines in each file.Args:
Pattern to split on.
File template to generate from. You can control where in the filenames the
sequential number will appear by inserting a series of "?" in it.
```## Installation
If you have Go installed and a proper `$GOPATH` set up, you can install using the normal `go install` command:
```bash
go install github.com/Mange/splitfiles
```If not, you can [download precompiled binaries on the Releases page][releases].
### Autocompletion
You can then install shell autocompletion by adding one of these lines to your RC file:
```bash
# For bash
eval "$(splitfiles --completion-script-bash)"# For ZSH
eval "$(splitfiles --completion-script-zsh)"
```### Man page
You can install a man page with the following command:
```bash
splitfiles --help-man > /usr/local/share/man/man1/splitfiles.1
```Depending on your machine, you might need elevated priviliges to write to this directoy.
## License
See LICENSE file, but tl;dr: MIT.
[releases]: https://github.com/Mange/splitfiles/releases/