https://github.com/devlights/grep-docx
指定ディレクトリの下に存在する MS WORD ファイル (*.docx) をGREPコマンドのように検索します。
https://github.com/devlights/grep-docx
go golang grep grep-like msoffice ole word
Last synced: about 2 months ago
JSON representation
指定ディレクトリの下に存在する MS WORD ファイル (*.docx) をGREPコマンドのように検索します。
- Host: GitHub
- URL: https://github.com/devlights/grep-docx
- Owner: devlights
- License: mit
- Created: 2024-09-05T04:31:59.000Z (9 months ago)
- Default Branch: main
- Last Pushed: 2024-09-05T04:54:00.000Z (9 months ago)
- Last Synced: 2025-02-12T08:58:49.158Z (4 months ago)
- Topics: go, golang, grep, grep-like, msoffice, ole, word
- Language: Go
- Homepage:
- Size: 5.86 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# これは何?
指定ディレクトリの下に存在する MS WORD ファイル (*.docx) をGREPコマンドのように検索します。
対象のWORDファイルが存在していて、どこに書いてあるのかが分からない時などに良かったらご利用ください。
Windowsのみで動作します。
## インストール
```sh
go install github.com/grep-docx/cmd/grep-docx@latest
```## 使い方
```sh
$ ./grep-docx.exe -h
Usage of ./grep-docx.exe:
-debug
debug mode
-dir string
directory (default ".")
-json
output as JSON
-only-hit
show ONLY HIT (default true)
-text string
search text
-verbose
verbose mode
```ヒットした文書のパスが知りたい場合は以下のようにします。
```sh
$ ./grep-docx.exe -dir ~/path/to/documents -text "データベースサイズ"
test.docx: HIT
```ヒットした箇所も見たい場合は ```-verbose``` オプションを付与するとみることが出来ます。
```sh
$ ./grep-docx.exe -dir ~/path/to/documents -text "データベース*サイズ" -verbose
```結果をjsonで出力したい場合は ```-json``` オプションを付与します。
```sh
$ ./grep-docx.exe -dir ~/path/to/documents -text "データベース*サイズ" -verbose -json
```## ビルド方法
[Task](https://taskfile.dev/#/) を使っています。詳細は [Taskfile.yml](./Taskfile.yml) を参照ください。
```sh
$ task build
```