The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 2 Weeks Ago
antuan antuan is offline
Registered User
  
 

Join Date: Sep 2009
Posts: 10
Question Ayuda con SED

Saludos

Necesito utilizar SED para crear una herramienta que me facilite el trabajo. El objetivo es filtrar información de un log para que me muestre solamente los registros que contengan una determinada cadena. El formato de cada registro es el siguiente:

a) un registro puede contener varias lineas.
b) empiezan siempre con una fecha

Hasta ahora he conseguido utilizar SED para introducir una linea en blanco entre registro y registro: cat registro.log | sed '/^2009-11-06/{x;p;x;}' (la fecha la sustituyo por una variable que tomo del comando date)

Con esto consigo insertar una linea en blanco encima de cada registro de manera que ahora existe un criterio para saber donde comienza y termina un registro, pero ahora necesito que solamente muestre aquellos registros que contengan una determinada cadena. Alguien puede ayudarme? Muchas gracias
  #2 (permalink)  
Old 2 Weeks Ago
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,839
Hello.

Per our forum rules, all posts must be in English.

We do provide translation services for posts from English to a number of languages as a benefit to users. However, posts must be in English.

Please repost in English.

Thank you for your cooperation.

The UNIX and Linux Forums.
Closed Thread

Bookmarks

Tags
sed, sed awk string extract

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:31 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0