I have a tab-separated file I need to order by the length of the first field. I've found samples of a line that should do that for me, but it's giving very strange results:
awk -F\t '{print length($1) " " $0|"sort -rn"}' SpanishGlossary.utf8 | sed 's/^.[^>]*>/>/' > test.tmp
... gives this (several representative samples -- it's a very long file):
56 cafés especiales y orgánicos special and organic coffees
56 amplia experiencia gerencial broad managerial experience
55 una fundada confianza en que a well-founded confidence that
55 Servicios de Desarrollo Empresarial Business Development Services
...
6 son estas are these
6 son entregadas a are given to
6 son determinantes para are crucial for
6 son autolimitativos are self-limiting
...
0 tal grado de such a degree of
0 tales such
0 tales propósitos such purposes
0 tales principios such principles
0 tales o cuales this or that
That leading number should be the length of the first field, but it's obviously not. I don't know what that's counting.
What am I doing wrong? Thanks.