Browse Source

Add script to extract iata from 1e100.txt

lennylxx 7 years ago
parent
commit
4e96dae57d
3 changed files with 9 additions and 1 deletions
  1. 2 0
      data/iata.txt
  2. 0 1
      tools/extract_iata.sh
  3. 7 0
      tools/extract_iata_1e100.sh

+ 2 - 0
data/iata.txt

@@ -2,6 +2,7 @@ ams 5hn
 arn 5go
 atl 5ua
 ber cxg
+bom cvh
 bru cg0
 bud c0q
 cbf jc4
@@ -45,6 +46,7 @@ sin npo
 sjc nwj
 sof nv4
 svo n8v
+syd ntq
 tpe u2x
 tsa un5
 waw f5f

+ 0 - 1
tools/extract_iata.sh

@@ -5,4 +5,3 @@ cat $d/../hosts \
 	| xargs -i sh -c "$d/conv.py -s {}; echo {}" \
 	| paste -d' ' - - \
 	| sort -k1 -u - $d/../data/iata.txt
-

+ 7 - 0
tools/extract_iata_1e100.sh

@@ -0,0 +1,7 @@
+d=$(dirname $0)
+cat $d/../snippets/1e100.txt \
+	| grep -oP '([a-z0-9]{3})(?=([a-z0-9]{5}\-in))' \
+	| sort -u \
+	| xargs -i sh -c "echo {}; $d/conv.py -i {}" \
+	| paste -d' ' - - \
+	| sort -k1 -u - $d/../data/iata.txt