Last active
April 14, 2024 06:05
-
-
Save tabimoba/865dc77db3eb34fa317ef9a321c425c5 to your computer and use it in GitHub Desktop.
Pocketからエクスポートして出力されたhtmlファイルをタブ区切りテキストに変換
This file contains hidden or 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
#!/bin/sh | |
# @see https://qiita.com/tabimoba/items/9e7f765ce5d68b3387fd | |
echo -e "url\ttime_added\ttags\ttitle" > ril_export.txt | |
cat ril_export.html \ | |
| sed -z 's/\t//g' \ | |
| sed -z 's/\n/ /g' \ | |
| sed -z 's/<li>/\n<li>/g' \ | |
| sed -z 's/<\/li>/<\/li>\n/g' \ | |
| grep '<li>' \ | |
| sed 's/.*<li><a href="\(.*\)" time_added="\(.*\)" tags="\(.*\)">\(.*\)<\/a><\/li>/\1\t\2\t\3\t\4/g' >> ril_export.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment