ワンライナーでMLSから楽天モバイルのみのCSV作成

www.web-dev-qa-db-ja.com

curl -s https://location.services.mozilla.com/downloads \
| xmllint --html --xpath 'string(/html/body/div/section/ul/li[1]/a/@href)' - \
| xargs -n 1 curl -s \
| gzip -d \
| awk 'BEGIN{FS=","} $1 == "LTE" && $2 == 440 && $3 == 11 {print $0}' > mls_44011.csv

future-architect.github.io

curl -sS https://location.services.mozilla.com/downloads \
| xmllint --html --xpath '/html/body/div/section/div/ul/li/a[contains(@href, "MLS-diff-cell-export")]/@href' - \
| xargs -n 1 \
| cut -d= -f2 \
| xargs -n 1 curl -s \
| gzip -d \
| awk 'BEGIN{FS=","} $1 == "LTE" && $2 == 440 && $3 == 11 {print $0}' > mls_44011.csv

awk 'NR==1 || FNR!=1'

zenn.dev

curl -sS https://location.services.mozilla.com/downloads \
| xmllint --html --xpath 'string(/html/body/div/section/ul/li[1]/a/@href)' - \
| xargs -n 1 curl -s \
| gzip -d \
| awk 'BEGIN{FS=","; OFS=","; print "area,cell,unit,lon,lat,range,samples,created,updated"} ($1 == "LTE" && $2 == 440 && $3 == 11 && $5 >= 188743680 && $5 < 190023680 && $6 != "" && $9 > 0) {print $4,$5,$6,$7,$8,$9,$10,$12,$13}' > mls_44011.csv