Created
October 7, 2020 14:25
-
-
Save kazu0620/2833da653c24dfb59f4a22c88c4d9935 to your computer and use it in GitHub Desktop.
KindleでExportしたハイライトを整形する
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
File.open("./words.html"){|f| | |
f.each_line do |line| | |
match = line.match(/<div class='noteText'>(.+)<\/h3>/) | |
if match !=nil | |
puts match[1] | |
.gsub(":", "") | |
.gsub(".", "") | |
.gsub(")", "") | |
.gsub("”", "") | |
.gsub("—", "") | |
.gsub(",", "") | |
.strip | |
end | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment