diff options
author | typebrook <typebrook@gmail.com> | 2019-11-12 14:30:20 +0800 |
---|---|---|
committer | typebrook <typebrook@gmail.com> | 2019-11-12 14:30:20 +0800 |
commit | 2d2594e95e3e6a52ddb90cb66165ec297243b5d0 (patch) | |
tree | 81a57cf2b10bd31d3a1f8feeb85e84cc990ec519 | |
parent | a84199f155f56d13d554c9427b5351d0d8807ef7 (diff) |
update
-rwxr-xr-x | scripts/csv.move_column (renamed from scripts/csv_reorder) | 0 | ||||
-rwxr-xr-x | scripts/csv.reorder | 17 | ||||
-rw-r--r-- | utils/osm | 3 |
3 files changed, 19 insertions, 1 deletions
diff --git a/scripts/csv_reorder b/scripts/csv.move_column index a62701f..a62701f 100755 --- a/scripts/csv_reorder +++ b/scripts/csv.move_column | |||
diff --git a/scripts/csv.reorder b/scripts/csv.reorder new file mode 100755 index 0000000..ef9766b --- /dev/null +++ b/scripts/csv.reorder | |||
@@ -0,0 +1,17 @@ | |||
1 | #! /bin/bash | ||
2 | |||
3 | # show each field with index in csv | ||
4 | echo -------------- > /dev/tty | ||
5 | head -1 < $1 | awk -F',' '{for (i=1; i<=NF; i++) printf $i "_" i " "; print ""}' > /dev/tty | ||
6 | echo -------------- > /dev/tty | ||
7 | echo > /dev/tty | ||
8 | |||
9 | # get index of lon/lat column | ||
10 | read -p "type column numbers by new order, like 3 2 1: " order | ||
11 | |||
12 | arrange=$(echo $order | sed -r 's/([^ ]+)/$\1/g' | tr ' ' ',') | ||
13 | |||
14 | cat $1 |\ | ||
15 | awk -F',' "BEGIN{OFS=\",\"}{print $arrange}" | ||
16 | |||
17 | |||
@@ -178,12 +178,13 @@ osm.api.changeset.create() { | |||
178 | info="<osm> | 178 | info="<osm> |
179 | <changeset> | 179 | <changeset> |
180 | <tag k='comment' v='$comment'/> | 180 | <tag k='comment' v='$comment'/> |
181 | <tag k='bot' v='yes'/> | ||
181 | </changeset> | 182 | </changeset> |
182 | </osm> | 183 | </osm> |
183 | " | 184 | " |
184 | 185 | ||
185 | echo $info |\ | 186 | echo $info |\ |
186 | curl -u $OSM_USER_PASSWD -i --upload-file - $OSM_API/changeset/create |\ | 187 | curl -u $OSM_USER_PASSWD --upload-file - $OSM_API/changeset/create |\ |
187 | tee /dev/tty |\ | 188 | tee /dev/tty |\ |
188 | tail -1 | read changeset_id | 189 | tail -1 | read changeset_id |
189 | 190 | ||