Skip to main content

Simple CLI application for searching keywords/phrases or regular expression patterns from text files.

Project description

find-from-files

Simple CLI application for searching keywords/phrases or regular expression patterns from text files.

Usage

usage: find-from-files [-h] [-l] [-r] [-s [SUFFIX ...]] [-S [SKIP ...]] [-a]
  [-q] [-qq] base_directory search_string

This script can be useful, e.g., for analyzing log files. When used without the
--regex flag, it traverses through directories starting from the
<base_directory> and prints the name of the file containing <search_string> and
the line that it is on. This is handy if you want to quickly find the files
that contain the string you are looking for. When used with the --regex flag,
it searches for the <search_string> with Python regular expression function
re.findall() in the files, and prints a summary containing the matches and
their number. This allows you to search for all occurrences of a pattern in
files. If the --whole-line flag is used, the whole line is printed instead of
just the match (does nothing without the --regex flag).

positional arguments:
  base_directory        Base directory to start the search from.
  search_string         String/regex to search for.

options:
  -h, --help            show this help message and exit
  -l, --whole-line      Search for the whole line containing the search string.
                        Only works with the --regexp flag.
  -r, --regexp          Search using regular expression.
  -s, --suffix [SUFFIX ...]
                        File suffix to search for. Files without this suffix
                        will be skipped.
  -S, --skip [SKIP ...]
                        Skip folders that start with this prefix.
  -a, --no-ansi         Do not use ANSI codes for output. Redirections never
                        contain ANSI codes.
  -q, --quiet           Do not print skipped folders or files.
  -qq, --quieter        Do not print skipped folders or files, and only print
                        the files that contain the search string/pattern.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

find_from_files-1.0.1.tar.gz (7.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

find_from_files-1.0.1-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file find_from_files-1.0.1.tar.gz.

File metadata

  • Download URL: find_from_files-1.0.1.tar.gz
  • Upload date:
  • Size: 7.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for find_from_files-1.0.1.tar.gz
Algorithm Hash digest
SHA256 45af1b6c3bfda9d83d3402bef8574b8feb438989354cd1a5fd5f880e91adb573
MD5 7be85ab83487e3a49700960ad2aa3e99
BLAKE2b-256 9037e330479d68053f5030e9fd6edd4d4b4373c9162280587eaf82f7cd2774dd

See more details on using hashes here.

File details

Details for the file find_from_files-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: find_from_files-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 9.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.0.1 CPython/3.13.2 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for find_from_files-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ccd5a6c27cab9719760cd96f7ff475351a2b224d1e0da799c9acdb7345078c0b
MD5 cf4656907d394901b8821b969e889a16
BLAKE2b-256 4e00d2fdd078e37e7275e72da16d46b061a125d9f799df8abcdc070c758dd370

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page