0
1

More than 1 year has passed since last update.

テキストファイルのURLを抽出

Last updated at Posted at 2021-12-12
grep -oE 'http(s?)://[0-9a-zA-Z?=#+_&:/.%\-]+' <file> 
open -a '/Applications/Google Chrome.app'
grep -oE 'http(s?)://[0-9a-zA-Z?=#+_&:/.%\-]+' <file>  |  xargs open -a '/Applications/Google Chrome.app'

SHIFTからUTF-8に変換する

 nkf -w <file>

『』 の文字を抽出

 nkf -w <file> | grep -oE '『.*』' | tr -d 『』

『』の文字を抽出して画面に表示するのみ(テキストの順番通り)

nkf -w 621-1.txt | grep -oE '『.*』' | sed 's/』/』\n/ '| grep -oE '『.*』' | sed 's/』/』\n/ '| grep -oE '『.*』' | tr -d 『』

『』の文字を抽出して、Chromeで検索する。ソートしている。

nkf -w 621-1.txt | grep -oE '『.*』' | sed 's/』/』\n/ '| grep -oE '『.*』' | sed 's/』/』\n/ '| sed 's/'\''// ' | grep -oE '『.*』' | tr -d 『』| sort | uniq | xargs -I {} open -a "Google Chrome" "https://google.co.jp/search?q={}"
0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1