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
What the command to find out the record length of a fixed length file? tranq01 UNIX for Dummies Questions & Answers 9 12-04-2008 04:04 PM
Length of a Unix filepath max length wilsontan UNIX for Dummies Questions & Answers 3 02-22-2006 10:19 AM
Sed working on lines of small length and not large length thanuman UNIX for Dummies Questions & Answers 3 04-15-2005 07:12 AM
creating a fixed length output from a variable length input r1500 Shell Programming and Scripting 2 12-03-2003 01:09 PM
Parsing data and retaining the full length of variable app4dxh Shell Programming and Scripting 3 11-22-2002 12:04 PM

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 09-10-2004
thanuman thanuman is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 24
length of data greater than 11

I need to get all the rows in a file, for which length of field at column 6 is greater than 11.

I tried

awk '{ if ($#1 >11) print $1}' filename

But Iam getting some errors

I tried different combinations like
awk '{ if (${#$1} >11) print $1}' filename

awk '{ if (${#1} >11) print $1}' filename

awk '{ if ($\{#1\} >11) print $1}' filename

But nothing is working... iam on sun solaris...

Can anyone help with what command, I can achieve this..
  #2 (permalink)  
Old 09-10-2004
PaulC PaulC is offline
Registered User
  
 

Join Date: Mar 2004
Location: Esher, Surrey, England.
Posts: 31
Try this

awk '{ if (length($6) > 11 ) print $1 }' filename
  #3 (permalink)  
Old 09-10-2004
thanuman thanuman is offline
Registered User
  
 

Join Date: Mar 2004
Posts: 24
Thanks .. It's working fine
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 04:43 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