![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 |
| Partial Request are coming... please help | pa.chidhambaram | IP Networking | 0 | 02-05-2008 11:19 AM |
| Can a shell script pull the first word (or nth word) off each line of a text file? | tricky | Shell Programming and Scripting | 5 | 08-17-2006 07:29 AM |
| vsftpd hiding partial uploads | jhod22 | Linux | 3 | 07-08-2006 05:49 PM |
| Grep all files matching partial filename | mharley | Shell Programming and Scripting | 3 | 06-08-2005 03:17 PM |
| Interested in partial command output. | videsh77 | UNIX for Dummies Questions & Answers | 1 | 12-15-2004 10:35 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
partial word replacement using sed
Example contents of a file:
001FILE 002FILE 003FILE 099FILE 111FILE Is it possible to search for [000-111]FILE and still keep the number part of the result in tact? The number portion is a changing variable but the FILE part stays the same. I want to search for all [000-111]FILE and space them out to "001 FILE" "002 FILE" etc. If I use sed 's/[000-111]FILE/&/g' It will basically replace with the same variable as found in search. I know how to search for the variable but don't know how to keep a portion of the result. The cut function would be nice but I can't seem to be able to call it in through sed. Searching for FILE and adding a space is not an option as some of the other contents have the same names and cannot be effected. Any ideas? |
| Bookmarks |
| Tags |
| solaris |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|