The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Advanced & Expert Users
.
google unix.com



UNIX for Advanced & Expert Users Expert-to-Expert. Learn advanced UNIX, UNIX commands, Linux, Operating Systems, System Administration, Programming, Shell, Shell Scripts, Solaris, Linux, HP-UX, AIX, OS X, BSD.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Regular Expressions ramky79 UNIX for Advanced & Expert Users 3 05-21-2008 06:13 PM
regular expressions melanie_pfefer UNIX for Dummies Questions & Answers 8 04-10-2008 05:24 AM
regular expressions whatever Shell Programming and Scripting 4 05-20-2007 05:30 PM
Help with regular expressions arushunter Shell Programming and Scripting 13 12-24-2006 12:31 AM
regular expressions jack1981 Shell Programming and Scripting 4 07-12-2006 04:10 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 05-26-2009
ramky79 ramky79 is offline
Registered User
  
 

Join Date: Sep 2006
Posts: 56
regular expressions

I have a flat file with the following drug names

Nutropin AQ 20mg PEN Cart 2ml
Norditropin Cart 15mg/1.5ml


I have to extract digits that are before mg i.e 20 and 15 ; how to do this using regular expressions

Thanks
ram
  #2 (permalink)  
Old 05-26-2009
Franklin52 Franklin52 is offline Forum Staff  
Moderator
  
 

Join Date: Feb 2007
Posts: 4,342
Something like:


Code:
sed 's/.* \(.*\)mg.*/\1/'

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 12:42 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