Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/kstenschke/grepc
Grep Chart: List strings that match a pattern in file(s), with and sorted by the amount of occurrences.
https://github.com/kstenschke/grepc
cli cli-tool find find-in-files gplv3 grep linux regex regular-expression
Last synced: about 1 month ago
JSON representation
Grep Chart: List strings that match a pattern in file(s), with and sorted by the amount of occurrences.
- Host: GitHub
- URL: https://github.com/kstenschke/grepc
- Owner: kstenschke
- License: gpl-3.0
- Created: 2021-04-29T21:04:25.000Z (almost 4 years ago)
- Default Branch: main
- Last Pushed: 2021-05-13T22:49:40.000Z (over 3 years ago)
- Last Synced: 2024-11-07T08:50:42.588Z (3 months ago)
- Topics: cli, cli-tool, find, find-in-files, gplv3, grep, linux, regex, regular-expression
- Language: C++
- Homepage:
- Size: 886 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Grep Chart
[![Build Status](https://api.travis-ci.com/kstenschke/grepc.svg?branch=main)](https://travis-ci.com/kstenschke/grepc)
[![Language grade: C/C++](https://img.shields.io/lgtm/grade/cpp/g/kstenschke/grepc.svg?logo=lgtm&logoWidth=18)](https://lgtm.com/projects/g/kstenschke/grepc/context:cpp)
[![CodeFactor](https://www.codefactor.io/repository/github/kstenschke/grepc/badge)](https://www.codefactor.io/repository/github/kstenschke/grepc)## Synopsis
``grepc PATTERN [FILE]``
``grepc -v PATTERN [FILE]``
``grepc -m= PATTERN [FILE]``PATTERN = an extended regular expression (ERE).
FILE = a relative or absolute path to a file or directory.## Description
**grepc** searches for PATTERN in each FILE. If no FILE is given, recursively
searches the working directory.
**grepc** prints all matches and their amount of occurrences.
Printed matches are sorted: 1. descending by amount of occurrences, 2. ascending
alphabetically by matching string.## Table of Contents
* [Synopsis](#synopsis)
* [Description](#description)
* [Table of Contents](#table-of-contents)
* [Options](#options)
* [-m, --min](#-m---min)
* [-v, --verbose](#-v---verbose)
* [-V, --version](#-v---version)
* [Usage examples](#usage-examples)
* [Find floating numbers sorted by popularity](#find-floating-numbers-and-their-popularity)
* [Find floating numbers sorted by popularity](#find-floating-numbers-and-their-popularity)
* [Build from source](#build-from-source)
* [Install](#install)
* [Conventions](#conventions)
* [Used third party applications](#used-third-party-applications)
* [Author and License](#author-and-license)## Options
### -m=, --min=
Minimum amount of occurrences. Matching string with less occurrences than the
given amount are not printed.### -v, --verbose
Print a results summary additionally to the grep chart:
* amount of total matches
* amount of matching strings
* amount of files searched### -V, --version
Print information about installed version of **grepc**, its license and
author(s).## Usage examples
### Find strings wrapped in double quotes, sorted by popularity
Find strings that are enclosed in double quotes, with a minimum length of ten
characters:``grepc '"[A-Za-z ]{10,}"' ./src``
**Output e.g.:**
```
156 "White Christmas"
155 "Candle in the Wind"
154 "In the Summertime"
153 "I will always love you"
152 "Rock around the Clock"
151 "Its now or never"
150 "We are the world"
```**Note:** to find strings that are enclosed in single quotes, these must be
escaped as: ``'\''``.
E.g.: ``grepc "'\''[A-Za-z]{4,}'\''"``### Find floating numbers sorted by popularity
Find floating numbers that have at least 14 decimal places.
``grepc -v '(\d\.\d+){16,}' ./src``
**Output e.g.:**
```
Found 177 matches in 83 out of 90 files.
There are 2 different matching strings:91 3.14159265358979
86 2.71828182845904
```## Build from source
``cmake CMakeLists.txt; make``
## Install
Build from source, than: ``sudo make install``
## Conventions
The source code of **grepc** follows the Google C++ Style Guide,
see: https://google.github.io/styleguide/cppguide.html**grepc** follows the [Semantic Versioning](https://semver.org) Scheme.
## Changelog
See [CHANGELOG.md](CHANGELOG.md)
## Used third party applications
| Application | License |
| -------------------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------- |
| [GNU Grep](https://www.gnu.org/software/grep/) | [GNU General Public License](https://www.gnu.org/licenses/licenses.html#GPL) |
| [GNU wc](https://www.gnu.org/software/coreutils/manual/html_node/wc-invocation.html#wc-invocation) | [GNU General Public License](https://www.gnu.org/licenses/licenses.html#GPL) |## Author and License
**grepc** was written by Kay Stenschke and is licensed under the
[GNU General Public License V3.0](https://www.gnu.org/licenses/licenses.html#GPL)```
Permissions of this strong copyleft license are conditioned on making available
complete source code of licensed works and modifications, which include larger
works using a licensed work, under the same license. Copyright and license
notices must be preserved. Contributors provide an express grant of patent
rights.
```