Created
October 4, 2014 11:37
-
-
Save masoo/82f99a4b27b4e7ea9c70 to your computer and use it in GitHub Desktop.
指定ディレクトリ以下にある htmlファイル内の文字一覧を出力するスクリプト
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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