GithubHelp home page GithubHelp logo

dmuth / index-zip-files Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 32 KB

A collection of scripts to index the filenames from ZIP files to allow for easy searching

License: Apache License 2.0

Shell 100.00%

index-zip-files's Introduction

Index ZIP Files

What this does: Imagine you have hundreds of ZIP files and you want to find a specific file in one of them, without unzipping each file. This makes that possible.

What this does not do: This does not index the content of each ZIP file.

Usage

Clone this repo, then run the various scripts like this:

  • ./zip-index SOURCE_DIR
  • ./zip-list SOURCE_DIR
  • ./zip-search SOURCE_DIR string

This is built to be fast, so no filename sorting is done at any point. If you want sorting, pipe into the sort command. :-)

If you would like to be able to run this app from anywhere in your filesystem, you'll want to...

Creating Aliases

Running ./zip-aliases SOURCE_DIR ALIAS_KEY will emit a series of aliases that can be used to index, list, and search ZIP files.

Example:

./zip-aliases ~/Dropbox/ dropbox
# 
# Generating aliases tied to this installation and source directory
# 
# Source Directory: /Users/doug/Dropbox
# Alias Key: dropbox
# 
alias zip-index-dropbox="$HOME/development/index-zip-files/zip-index $HOME/Dropbox"
alias zip-list-dropbox="$HOME/development/index-zip-files/zip-list $HOME/Dropbox"
alias zip-search-dropbox="$HOME/development/index-zip-files/zip-search $HOME/Dropbox"

Once you paste those three alias lines in shell, typing zip-index-dropbox from any directory will index your Dropbox folder's ZIP files, and zip-search-dropbox can be used to search it. And yes, aliases autocomplete in bash. :-)

Terminology

  • ZIP File: A compressed archive containing 1 or more files.
  • Index directory: A directory under indexed-files/ in the directory you indexed, which containes index files for a specific Source directory.
  • Index file: A plaintext file containing filenames of a single ZIP file.

Testing and Development

  • Running ./test.sh will run zip-create-test-files to build a sample directory structure containing ZIP files and then

Get in touch

I'm a software engineer based out of Philadelphia, PA. You can find me on Twitter, Facebook and on my blog. Feel free to drop by and say hi!

index-zip-files's People

Contributors

dmuth avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.