el lenguaje de programación gawk/awk

Páginas: 57 (14168 palabras) Publicado: 21 de marzo de 2014
El Lenguaj e de Prog rama ción AWK/G AWK
Una guía de Usuario para AWK

Jesús Alberto Vidal Cortés
http://inicia.es/de/chube
chube@inicia.es
Madrid, Febrero de 2002

-1-

Índice

1. INTRODUCCIÓN ........................................................................................................................................................................6
2. EMPEZANDOCON AWK ..........................................................................................................................................................7
UN EJEMPLO MUY SIMPLE .................................................................................................................................................................7
UN EJEMPLO CON DOS REGLAS..........................................................................................................................................................8
UN EJEMPLO MÁS COMPLEJO ............................................................................................................................................................9
CÓMO EJECUTAR LOS PRO GRAMAS AWK.........................................................................................................................................10
Programas de ejecución rápida (One-shot Throw-away) .......................................................................................................10
Ejecutar awk sin Ficheros deEntrada.....................................................................................................................................10
Ejecución de Programas Grandes...........................................................................................................................................11
Programas awkEjecutables.....................................................................................................................................................11
COMENTARIOS EN PROGRAMAS AWK .............................................................................................................................................12
SENTENCIAS FRENTE A LÍNEAS EN AWK ..........................................................................................................................................13
CUANDO USAR AWK.......................................................................................................................................................................14
3. LEYENDO FICHEROS DE ENTRADA..................................................................................................................................15
CÓMO SE PARTICIONA LA ENTRADA EN REGISTROS........................................................................................................................15
EXAMINANDO CAMPOS...................................................................................................................................................................16
REFERENCIAR CAMPOS SIN USAR CONSTANTES...............................................................................................................................17
CAMBIANDO LOS CONTENIDOS DE UN CAMPO .................................................................................................................................17
ESPECIFICANDO COMO ESTÁN SEPARADOS LOS CA MPOS .................................................................................................................18REGISTROS DE MÚLTIPLES LÍNEAS ..................................................................................................................................................20
ENTRADA EXPLÍCITA CON GETLINE .................................................................................................................................................21
CERRADO DE FICHEROS DE ENTRADA Y...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • Lenguajes de programacion
  • Lenguajes de programacion
  • Lenguajes de programación
  • lenguaje de programacion
  • lenguajes de programacion
  • Lenguaje De Programacion
  • lenguaje de programacion
  • Los Lenguajes De Programacion

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS