splitfiles

command module
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 18, 2016 License: MIT Imports: 8 Imported by: 0

README

splitfiles

usage: splitfiles [<flags>] <PATTERN> <TEMPLATE>

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>   Pattern to split on.
  <TEMPLATE>  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:

go install github.com/Mange/splitfiles
Autocompletion

You can then install shell autocompletion by adding one of these lines to your RC file:

# 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:

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL