![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
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 |
| ps command - time field | nhatch | UNIX for Dummies Questions & Answers | 1 | 05-12-2008 11:15 AM |
| insert EOD if value in Field 1 change | jmaskar | Shell Programming and Scripting | 2 | 02-05-2008 12:09 PM |
| How to change field seperator | onthetopo | Shell Programming and Scripting | 2 | 05-11-2007 12:11 PM |
| PS Command Field | akuma | Linux | 2 | 11-08-2005 09:49 AM |
| exec command and field descriptors.. | moxxx68 | UNIX for Dummies Questions & Answers | 5 | 12-04-2004 05:58 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
sed command to change 2nd field
Hi
I am a beginner to sed command, here I have a question about using sed to add a few characters into a token of a string. For example, I have a file, sqw:qqq:123124:uiqe dfd:ccc:12390:dfjis cde:aaa:21311:dfjsid and, I want the output to be, sqw:qqq:123124:uiqe dfd:*WW*ccc:12390:dfjis cde:aaa:21311:dfjsid then result is redirected to a new file. Looking for dfd as pattern, then add *WW* to its second field by using sed. I have tried to run below statement, which is working on the terminal but not in the script. cat file | awk -F: '{print $2}' | sed 's:^:\*WW\*:' I have read a couple of sed threads at this forum, but I am still not able to solve above question by myself. Pls help me out. Thanks. |
|
||||
|
Quote:
cde:aaa:21311:dfjsid to cde:aaa:00000:dfjsid |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|