The UNIX and Linux Forums  


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
How to extract two words at the same time. Aejaz UNIX for Advanced & Expert Users 6 04-30-2008 10:09 AM
Extract words before and after a pattern/regexp manthasirisha Shell Programming and Scripting 3 03-21-2008 07:38 AM
Need to strip few letters achararun Shell Programming and Scripting 5 03-11-2008 09:08 PM
transposing letters myscsa2004 Shell Programming and Scripting 4 05-12-2004 11:11 AM
capital letters GONE! blogg UNIX for Dummies Questions & Answers 8 12-11-2002 09:44 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 02-19-2008
manish205 manish205 is offline
Registered User
  
 

Join Date: Feb 2008
Posts: 5
Post extract words with even numbr of letters

Hello All

I need to extract words which are of even number of letters and not greater than 10.

Any help??

Thanks,
Manish
  #2 (permalink)  
Old 02-19-2008
Klashxx's Avatar
Klashxx Klashxx is offline Forum Advisor  
HP-UX/Linux/Oracle
  
 

Join Date: Feb 2006
Location: Almerķa, Spain
Posts: 393
Show us your input and you expected output.
  #3 (permalink)  
Old 02-19-2008
vino's Avatar
vino vino is offline Forum Staff  
Supporter (in vino veritas)
  
 

Join Date: Feb 2005
Location: Bangalore, India
Posts: 2,798
Perhaps something like

Code:
tr " " "\n" < file.txt | sed -n -e "/^[[:alpha:]]\{2\}$/p;/^[[:alpha:]]\{4\}$/p;/^[[:alpha:]]\{6\}$/p;/^[[:alpha:]]\{8\}$/p"
  #4 (permalink)  
Old 02-19-2008
Tytalus's Avatar
Tytalus Tytalus is offline Forum Advisor  
echo {1..9}^2\;|bc
  
 

Join Date: Jun 2003
Location: Scotland
Posts: 431
hacky solution:

Code:
 egrep "^..$|^\(..\)$|^......$|^........$" file
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 05:34 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