Renaming file, adapting scripts
This commit is contained in:
parent
bd8d441ef0
commit
12a72a3dd6
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
FILE_RANGE="./temp.txt"
|
FILE_RANGE="./source/range-country_code.txt"
|
||||||
FILE_COUNTRY_CODE="./GeoLite2-Country-CSV_20190806/GeoLite2-Country-Locations-fr.csv"
|
FILE_COUNTRY_CODE="./source/GeoLite2-Country-CSV_20190806/GeoLite2-Country-Locations-fr.csv"
|
||||||
CODE=0
|
CODE=0
|
||||||
|
|
||||||
while read p; do
|
while read p; do
|
||||||
@ -28,4 +28,4 @@ while read p; do
|
|||||||
printf "%s %s\n" "$RANGE" "$CONTINENT" >> NA.txt
|
printf "%s %s\n" "$RANGE" "$CONTINENT" >> NA.txt
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done < temp.txt
|
done < $FILE_RANGE
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
FILE_RANGE="./temp.txt"
|
FILE_RANGE="./source/range-country_code.txt"
|
||||||
FILE_COUNTRY_CODE="./GeoLite2-Country-CSV_20190806/GeoLite2-Country-Locations-fr.csv"
|
FILE_COUNTRY_CODE="./source/GeoLite2-Country-CSV_20190806/GeoLite2-Country-Locations-fr.csv"
|
||||||
CODE=0
|
CODE=0
|
||||||
|
|
||||||
while read p; do
|
while read p; do
|
||||||
@ -9,4 +9,4 @@ while read p; do
|
|||||||
RANGE=$(awk -F ',' '{print $1}' <<< $p)
|
RANGE=$(awk -F ',' '{print $1}' <<< $p)
|
||||||
COUNTRY=$(awk -v country_code="$CODE" -F ',' '$0 ~ country_code {print $5}' $FILE_COUNTRY_CODE)
|
COUNTRY=$(awk -v country_code="$CODE" -F ',' '$0 ~ country_code {print $5}' $FILE_COUNTRY_CODE)
|
||||||
printf "%s\n" "$RANGE" >> ./country/"$COUNTRY".txt
|
printf "%s\n" "$RANGE" >> ./country/"$COUNTRY".txt
|
||||||
done < temp.txt
|
done < $FILE_RANGE
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user