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.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
bc, negative values and "total" (whit swapped -) columb Shell Programming and Scripting 3 3 Weeks Ago 04:33 PM
Whats the problem whit my script??? cristi2008 Shell Programming and Scripting 4 11-29-2008 02:34 PM
connect whit Telnet without password raffyTxT SUN Solaris 2 10-18-2004 11:43 AM
compress and descompress file whit pack jtapia UNIX for Dummies Questions & Answers 6 12-05-2003 08:39 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish 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
SOS whit SED

Hello,

I know how to get a solution of a filtering problem with AWK, but i need change default field separator by a regular expression. awk -F "xxx"

What i want to do is take a stranza as a field, so the field separator must be a EMPTY line. Does anybody how to do that??

a example:

blablablablablablablablablablablablablablablabla
blablablablablablablablablablablablablablablabla
blablablablablablablablablablablablablablablabla

blablablablablablablablablablablablablablablabla
blablablablablablablablablablablablablablablabla
blablablablablablablablablablablablablablablabla

blablablablablablablablablablablablablablablabla
blablablablablablablablablablablablablablablabla
blablablablablablablablablablablablablablablabla

I want to take as a field each one of those three stranzas.

Thank you very much.
Told me I look good

Last edited by antuan; 2 Weeks Ago at 09:01 AM..
  #2 (permalink)  
Old 2 Weeks Ago
OPTIMUS_prime OPTIMUS_prime is offline
Registered User
  
 

Join Date: Jan 2007
Posts: 9
I couldn't understand your second post. Here is your original post, translated into English:

Greetings,

I need to use SED to create a tool to make my job easier. The objective is to filter a log to show me only those entries that contain a certain string. The format of each entry is as follows:

a) an entry may contain several lines
b) they always begin with a date

Before now I've been able to use SED to insert a blank line between entries: cat registro.log | sed '/^2009-11-06/{x;p;x;}' (I replace the date with a variable obtained with the date command)

With this I've been able to insert a blank line before each log entry so that there is now a way to know when each log entry begins and ends, but now I need to show only those entries that contain a certain string. Can someone help me? Thank you very much.
Sponsored Links
Reply

Bookmarks

Tags
sed

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 02:57 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