Introduce old redir program
[lcapit-junk-code.git] / CEP / cep-search.awk
blobc8751d9de247d105acf2983b6c9fb5afecca269e
2 # Run with: awk -f cep-search.awk -v cep=cep-number filename
5 BEGIN {
6 if (!cep) {
7 printf("usage: awk -f cep-search.awk ")
8 printf("-v cep=cep-number filename\n")
11 FS = ";"
12 found = 0
15 $1 == cep {
16 printf("\nCEP: %s\nEstado: %s\nCidade: %s\n", $1, $2, $3)
17 printf("Bairro: %s\nRua: %s\n", $4, $5)
18 found = 1
21 END {
22 if (!found)
23 printf("%s: not found", cep)
24 printf("\n")