Skip to content

Instantly share code, notes, and snippets.

@tabimoba
Last active April 14, 2024 06:05
Show Gist options
  • Save tabimoba/865dc77db3eb34fa317ef9a321c425c5 to your computer and use it in GitHub Desktop.
Save tabimoba/865dc77db3eb34fa317ef9a321c425c5 to your computer and use it in GitHub Desktop.
Pocketからエクスポートして出力されたhtmlファイルをタブ区切りテキストに変換
#!/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