Skip to content

Commit c0d908d

Browse files
Use wc for now to count text records (#35)
* Use wc for now to count text records Addresses issue with dcw-figure.sh in #5742. * Change file name (t to $$.C.txt) Co-authored-by: Federico Esteban <federico.esteban@gmail.com>
1 parent 1eee4d2 commit c0d908d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

dcw-figure.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
ps=dcw-figure.ps
55
here=$(pwd)
66
grep -v '^#' dcw-countries.txt > /tmp/$$.C.txt
7-
n_poly=$(gmt info -Fi -o2 /tmp/$$.C.txt)
7+
n_poly=$(cat /tmp/$$.C.txt | wc -l | awk '{printf "%d\n", $1}')
88
gmt makecpt -T0/$n_poly/1 -Ccategorical -N > /tmp/$$.cpt
99
paste /tmp/$$.cpt /tmp/$$.C.txt > /tmp/$$.txt
1010
grep -v '^#' dcw-states.txt | awk '{printf "%s.%s\n", $1, $2}' > /tmp/$$.S.txt

0 commit comments

Comments
 (0)