Skip to content

Instantly share code, notes, and snippets.

@masoo
Created February 29, 2016 04:57
Show Gist options
  • Save masoo/7e90e5cb01548a37b2b6 to your computer and use it in GitHub Desktop.
Save masoo/7e90e5cb01548a37b2b6 to your computer and use it in GitHub Desktop.
フォルダ内の .html ファイルの文字一覧を出力するスクリプト
# coding: utf-8
require 'find'
target_dir = ARGV[0]
all_string = []
Find.find(target_dir) do |file|
if File.extname(file) == ".html"
content = File.open(file).read
file_string_array = content.split('')
all_string = all_string + file_string_array
end
end
puts all_string.uniq.sort.join('')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment