Advertisement
a_9

unnecessary awk redux

a_9
Jan 23rd, 2016
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Awk 0.18 KB | None | 0 0
  1. BEGIN {
  2.     RS="[\n,]"
  3.     regex = "^#[0-9a-fA-F]{8}$"
  4. }
  5.  
  6. $0 ~ regex { a[substr($1,0,7)] }
  7.  
  8. END {
  9.     PROCINFO["sorted_in"] = "@ind_str_asc"
  10.     for (b in a) {
  11.         printf "\"%s\",\n", b
  12.     }
  13. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement