Visit Our UNIX and Linux User Community


SOS whit SED


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting SOS whit SED
# 1  
Old 11-06-2009
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; 11-06-2009 at 10:01 AM..
# 2  
Old 11-06-2009
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.

Previous Thread | Next Thread
Test Your Knowledge in Computers #428
Difficulty: Medium
JavaScript supports regular expressions in a manner similar to Perl.
True or False?

10 More Discussions You Might Find Interesting

1. HP-UX

sos about swpackage AND swinstall

hi all, I just want to make a depot package.All steps: 1. make a psf file # PSF which define the myutil product depot layout_version 1.0 tag ddmi_linux_installer title ddmi_linux_installer # Product definition vendor tag HP title Hewlett-Packard Company product tag... (0 Replies)
Discussion started by: lb1111830
0 Replies

2. Shell Programming and Scripting

bc, negative values and "total" (whit swapped -)

Hi All, I need to sum numbers, in bash, input is this: 10.00 12.33 14.99 134.00 1211.09 130.01- <--- it is negative, but "-" is at the end.. 901.99 10.34- <--- another negative number... bc -l is giving me error so only solution to my problem would be to swap - to the... (3 Replies)
Discussion started by: columb
3 Replies

3. Solaris

sun connect :SOS

hi all, does someone have any information about "sun connect" (like documentation , web site , forums , explanations .....) ? because i will need this software in my job & i don't know how to use it :o (4 Replies)
Discussion started by: lid-j-one
4 Replies

4. Shell Programming and Scripting

Whats the problem whit my script???

I want to take the even-numbered lines from a file and put them in a separate file and the same thing with the odd-numbered lines. #!/bin/bash file=$1 awk ' { if ( NR % 2 == 0) { (( getline < "$file" ) > "even.txt" )} else { (( getline < "$file" ) > "odd.txt" )} } ' $file (4 Replies)
Discussion started by: cristi2008
4 Replies

5. Shell Programming and Scripting

Sos

Dear "expert", I need to know the command syntax to get the last field of the line below using shell or awk. MD5... (4 Replies)
Discussion started by: Lee Soon Yau
4 Replies

6. Shell Programming and Scripting

Sos Sos

INPUT---> USER | User1 | DisplayName1 | HomeTown1 | 987654321 | 27-07-1991 | M i want to separate out all the fields of the file which has the format specified above , with the use of awk. I was writing that to the mysql by batch-file. But now there is problem , in databse i have defined the... (2 Replies)
Discussion started by: yogesh_powar
2 Replies

7. Solaris

connect whit Telnet without password

It's possible to connect whit Telnet (or rlogin) whithout password??? I must write a script (this script run on a windows machine), then after the connection on Unix machine, run a perl script and exit. I can know if an host can be consedered "Trusted" like SSH protocol? Thanks! (2 Replies)
Discussion started by: raffyTxT
2 Replies

8. UNIX for Dummies Questions & Answers

compress and descompress file whit pack

hi i dont can traspassing file from unix sco compress whit pack or compress i dont can descompress whit other program... how i can do descompress that file in windows me.??? thank very much... pd:sorry my inglish (6 Replies)
Discussion started by: jtapia
6 Replies

9. UNIX for Dummies Questions & Answers

[sos]How to resure my system.

Yesterday,I have a unnormal shutdown of my SCO Unix system,when I boot again,There are lots of Errors (e.g policy manager error, ifor_pmd error etc.),Most seriously,I can use my "CC" compiler: when I compile my *.c files. Who Can Help Me ! Please Don't spare your instructions! Thanks a... (5 Replies)
Discussion started by: dingxf
5 Replies

10. UNIX for Dummies Questions & Answers

(SOS) Please help !

Does anybody can help me with the definition of "terminal" DTE and DCE in context to Unix ?. This has something to do with devices in Unix. I need it asap. Thank you very much !:confused: (1 Reply)
Discussion started by: aqua_jan
1 Replies

Featured Tech Videos