Commit 329e38b7 authored by Khaytsus's avatar Khaytsus

Add some verbosity to csv2id.sh

Add some output to show each area and the global worldwide data being downloaded and rename the worldwide max count wwcount.  Also a trailing line to say the output filename.
parent 6cf156be
......@@ -5,7 +5,7 @@
datapath="/home/wally/ham/Radios/GD77/SW/DMR"
# Array of id,name which the script iterates over to get data, update for your needs
# Here I am getting all US (averages to about a week worth of contacts fwhen limited
# Here I am getting all US (averages to about a week worth of contacts when limited
# to 500) plus some targeted states I'm interested in which pulls in a lot more calls
# per those states
......@@ -19,9 +19,11 @@ max=10900
count=500
# Generic Last heard count (add additional World Wide last-heard users)
genericcount=6000
# The data above is about 4000 entries, so this fills it out to about 10k
wwcount=6000
# Shouldn't need to touch below here
ts=`date +"%Y-%m-%d"`
output=${ts}.csv
......@@ -31,11 +33,13 @@ cd ${datapath}
for i in ${ids[@]}; do
id=`echo $i | cut -f 1 -d ','`
name=`echo $i | cut -f 2 -d ','`
echo "Getting ${name} (id $id}) (${count} max)"
curl -s -o ${name}-${id}.csv "http://ham-digital.org/user_by_lh.php?id=${id}&cnt=${count}"
done
# Pull last heard from all around the world, with the genericcount limiting how many
# 5000 is about 6 days worth give or take
echo "Getting worldwide Last Heard data (${wwcount} max)"
curl -s -o lh-0000.csv "http://ham-digital.org/user_by_lh.php?cnt=${genericcount}"
# Combine all of them into a single file formatted for import
......@@ -45,4 +49,7 @@ awk 'BEGIN { FS=";"; OFS=","; } {print $3,$2,$4,",,,,<br/>"}' *-???.csv *-????.c
lines=`wc -l ${output} | cut -f 1 -d " "`
if [ ${lines} -gt ${max} ]; then
echo "Warning: CSV contains more than ${max} lines"
fi
\ No newline at end of file
fi
echo ""
echo "${output} should be ready to import using ActiveClient.exe"
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment