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 > 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
How to Extract string? namrata5 High Level Programming 2 10-24-2007 03:17 AM
Stripping a portion of string from behind!!! kumarsaravana_s UNIX for Dummies Questions & Answers 5 03-18-2007 02:21 PM
How to extract a sub-string from a string? JohnHealey UNIX for Dummies Questions & Answers 4 01-22-2007 04:29 AM
Extract String sehgalniraj UNIX for Dummies Questions & Answers 1 09-25-2006 12:35 PM
Extract String bestbuyernc Shell Programming and Scripting 5 11-14-2005 03:42 PM

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 09-26-2001
ds_sastry ds_sastry is offline
Registered User
  
 

Join Date: Sep 2001
Posts: 5
How to extract a portion of a string from the whole string

How to extract a portion of a string from a full string using unix.

For example:

Say source string is = "req92374923.log"

I want only the numeric portion of the string say "92374923" how to do that in Unix.
  #2 (permalink)  
Old 09-26-2001
98_1LE 98_1LE is offline Forum Advisor  
Registered User
  
 

Join Date: Dec 2000
Location: Greater Dallas area
Posts: 405
I suppose it depends on what you are really trying to do. One way would be:
Code:
echo req92374923.log | cut -c4-11
You can also use sed, awk or possible basename.
  #3 (permalink)  
Old 09-29-2001
ds_sastry ds_sastry is offline
Registered User
  
 

Join Date: Sep 2001
Posts: 5
Thanks 98_1LE

It worked fine..
Regards,
ds_sastry
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 08:41 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