Skip to content

Scan documents on a folder (pdf, djvu, txt, stuff like that). Clean file names, try to get some meta from file.

License

Notifications You must be signed in to change notification settings

EmmanuelOga/doc_scan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DocScan

Utils to get infomration from documents in a folder (doc, pdf, djvu, etc.)

Example

# Rename a bunch of documents on the current directory with a better
# name. The name will come from google data if an isbn is found in the
# document, or a cleaned version of the original name (by removing
# underscores, repeated spaces, etc.).

require 'doc_scan'
require 'fileutils'

ds = DocScan::Scanner.new do |ds|
  ds.path = "."
  ds.valid_extensions = ["pdf", "djvu"]
end

ds.each do |doc|
  puts doc.clean_path
  FileUtils.mv doc.path, doc.clean_path if doc.path != doc.clean_path rescue nil
end

About

Scan documents on a folder (pdf, djvu, txt, stuff like that). Clean file names, try to get some meta from file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages