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
Remove unwanted XML Tags ambals123 Shell Programming and Scripting 1 12-22-2007 05:34 AM
Filter unwanted lines Raynon Shell Programming and Scripting 15 10-11-2007 06:30 AM
Remove unwanted data? hitmansilentass Shell Programming and Scripting 24 05-09-2007 10:50 AM
Cutting text from one location to another hemangjani Shell Programming and Scripting 8 11-29-2006 12:49 PM
creation of unwanted directory mridula High Level Programming 6 10-05-2005 11:40 AM

Closed Thread
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 11-29-2006
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
  
 

Join Date: Nov 2006
Location: Bulgaria
Posts: 1,318
cutting unwanted text

Hello,

I have a log file which looks like this :
Quote:
10-10-2006 08:44:45,802 [ some info here ] This is my Event : HTTP GET
10-10-2006 08:44:45,802 [ some info here ] Time duration: 1013 mls. (1 sec.)
I want to cut out some text and get printed only : "HTTP GET" and "Time duration: 1013 mls. (1 sec.)" I tried searching the forum for such solution, but I was unable to find it.
I also tried
Code:
 awk '/duration/ { print $0 }' mylogfile.log
, but this return the entire row of data. Please shed some light on this, thanks.
  #2 (permalink)  
Old 11-29-2006
matrixmadhan matrixmadhan is offline Forum Advisor  
Technorati Master
  
 

Join Date: Mar 2005
Location: leaf node in B+ tree
Posts: 2,944
Code:
awk -F": " '{ print $2 }' filename
check,
There is a space after :,
as per your input file patter
  #3 (permalink)  
Old 11-29-2006
sysgate's Avatar
sysgate sysgate is offline Forum Advisor  
Unix based
  
 

Join Date: Nov 2006
Location: Bulgaria
Posts: 1,318
thank you man, it works perfectly.
Closed Thread

Bookmarks

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 10:15 PM.


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