题解 | #打印字母数小于8的单词#
打印字母数小于8的单词
http://www.nowcoder.com/practice/bd5b5d4b93a04226a81afbabf0be797d
awk string concat
awk '
{
s = $0
n = length(s)
l = 1;
for (i = 1; i <= n; i++) {
c = substr(s, i, 1);
if (c !~ /[a-z]/) {
len = i - l
t = substr(s, l, len)
if (len < 8) print(t)
l = i + 1
}
}
last = substr(s, l)
if (length(last) < 8) print(last)
}
'