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 > 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
rm substitute with blacklist broli UNIX for Dummies Questions & Answers 2 12-06-2007 08:13 AM
Substitute File name vanand420 Shell Programming and Scripting 22 03-14-2007 02:40 AM
Substitute in vi kingdbag UNIX for Dummies Questions & Answers 5 01-17-2007 02:42 PM
how to substitute more than one word in a text file? forevercalz Shell Programming and Scripting 2 01-12-2006 06:32 AM
vi + regexp + substitute Lomic UNIX for Dummies Questions & Answers 9 12-10-2004 10:50 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 02-06-2008
solidhelix08 solidhelix08 is offline
Registered User
  
 

Join Date: Feb 2008
Location: Philippines
Posts: 6
In Help, Substitute Text ...

i'm writing a script that will extract and substitute a certain part of a data.
i'm having trouble with the substituting part ...

Here's my data looks like:

01/01/08-001-23:46:18-01/01/08-23:50:43
01/01/08-003-23:45:19-01/01/08-23:55:49
01/01/08-005-23:52:18-01/01/08-23:58:52

i want to change the second column i.e. 001,003,005 to:

CODE01 for 001, CODE03 for 003 and CODE05 for 005. so that it will look like this ...

01/01/08-CODE01-23:46:18-01/01/08-23:50:43
01/01/08-CODE03-23:45:19-01/01/08-23:55:49
01/01/08-CODE05-23:52:18-01/01/08-23:58:52

i have separate a file for the list of codes to be substituted. i tried using sed, but can't figure out how.


i'm on: using csh
SunOS 5.8 Generic_108528-22 sun4u sparc SUNW,UltraAX-MP

oh btw, im new here =D
 

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 07:49 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