0
에서 URL을 포함하는 열 추출 :이 같은 파일이 텍스트 파일
Timestamp URL Text
1331635241000 http://example.com Peoples footage at www.test.com,http://example4.com
1331635231000 http://example1.net crack the nuts http://example6.com
1331635280000 http://example2.net Loving this
각 열은 탭으로 분리됩니다. 나는 예를 들어이 같은 결과를 얻을 수 있도록 다음 한 URL의 경우 2 열 및 3 열 경우 만 URL을 추출 빈을 떠날 필요 :이 스크립트를 시도
URL Text
http://example.com www.test.com,http://example4.com
http://example1.net http://example6.com
http://example2.net
awk 'BEGIN {FS="\t"} {print $2,$3}' file | grep -oP '(((http|https|ftp|gopher)|mailto)[.:][^ >"\t]*|www\.[-a-z0-9.]+)[^ .,;\t>">\):]'
이 스크립트는 헤더가없는 단일 열에 모든 URL을 제공 할 수 있습니다. 이 문제를 해결하기위한 제안.