The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com



UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
compare columns from seven files and print the output smriti_shridhar Shell Programming and Scripting 7 06-11-2008 01:22 AM
AWK script to print all the columns excpet the one specified kn.naresh Shell Programming and Scripting 3 05-22-2008 08:34 AM
read input from 2 files and print them in alternate columns sriram.s Shell Programming and Scripting 1 02-27-2008 02:12 PM
Print lines with search string at specific position HealthyGuy Shell Programming and Scripting 4 12-04-2006 09:47 AM
Print last 4 columns (variable column #) Da_Duck UNIX for Dummies Questions & Answers 19 02-27-2004 10:33 AM

 
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
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 04-26-2007
Ant1815 Ant1815 is offline
Registered User
  
 

Join Date: Apr 2007
Posts: 9
Can I search columns and print lines?

Hi. First post here.

I'm relatively new to UNIX (Solaris8) and writing my first real script, but I seem to have hit a brick wall. The odd thing is that it seems like it should be a simple task....but not with UNIX apparently.

I've got a large text file: 14000 lines with 10 columns.

I want to search the file purely on column 8 for a particular word, but if that word occurs I want to print the whole line.

If I 'grep' for the word it will show up in the other columns too, but I'm only interested in occurances in column 8.

What I need is something like grep $8 <word> <filename> but of course that command doesn't exist. nawk only deals with columns and won't give me the whole line.

Is there any way I can do this?

Thanks
 

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 01:27 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