Skip to content

Instantly share code, notes, and snippets.

@igmrrf
Created September 7, 2025 19:17
Show Gist options
  • Select an option

  • Save igmrrf/45b976b7401cd30287edabe2bb19f9f1 to your computer and use it in GitHub Desktop.

Select an option

Save igmrrf/45b976b7401cd30287edabe2bb19f9f1 to your computer and use it in GitHub Desktop.

Revisions

  1. igmrrf created this gist Sep 7, 2025.
    18 changes: 18 additions & 0 deletions extract_text.fish
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,18 @@
    #!/usr/bin/env fish

    # Check if folder path is provided
    if not set -q argv[1]
    echo "Usage: ./extract_all.fish <folder-path>"
    exit 1
    end

    set folder $argv[1]

    # Loop over image files and extract text
    for file in $folder/*.{png,jpg,jpeg}
    if test -f $file
    echo "Processing: $file"
    tesseract $file - -l eng
    echo ""
    end
    end