This is a discussion on To find and replace in text file within the Shell scripting forums, part of the Development/Scripting category; Hi, I need help on following problem. I have a text file something like below... I have to replace ":" ...
|
|||||||
| Register | FAQ | Members List | Calendar | Forgotten your password? | Mark Forums Read |
|
|||
|
Hi,
I need help on following problem. I have a text file something like below... I have to replace ":" "." "space" with , using either sed or awk can some one help me on this... Thanks in Advance.. ===================================== 21:2007.11.13 00:38:13:399 Env/TP-Processor8:INFO:CORE BEGIN Session=9C3ACA5E8BE596EC39D2761AC66EC9E2.bstby1 Active Sessions: 776 29:2007.11.13 00:38:13:918 Env/TP-Processor6:INFO:CORE BEGIN Session=3152E297D96912192109B8F9BEBB1446.bstby1 Active Sessions: 777 88:2007.11.13 00:38:15:832 Env/TP-Processor2:INFO:CORE BEGIN Session=50D731F3EE59D3595A25140F166E9F93.bstby1 Active Sessions: 767 116:2007.11.13 00:38:16:793 Env/TP-Processor7:INFO:CORE BEGIN Session=B7977F67D06591A78AA2F290DBCE6F2C.bstby1 Active Sessions: 768 144:2007.11.13 00:38:19:219 Env/TP-Processor12:INFO:CORE BEGIN Session=19C3468F71BC6B2BEA03C3F2D4F74E44.bstby1 Active Sessions: 769 172:2007.11.13 00:38:21:930 Env/TP-Processor2:INFO:CORE BEGIN Session=13DA23B1E5787E4E07B3098A17CAFBAC.bstby1 Active Sessions: 770 ============================================= |
| Sponsored Links | ||
|
|
|
|||
|
i got the below answer but if i m hving tht txt in file..where is the place int the script to mention my filename sam.txt
sam.txt contains 21:2007.11.13 00:38:13:399 Env/TP-Processor8:INFO:CORE BEGIN Session=9C3ACA5E8BE596EC39D2761AC66EC9E2.bstby1 Active Sessions: 776 29:2007.11.13 00:38:13:918 Env/TP-Processor6:INFO:CORE BEGIN Session=3152E297D96912192109B8F9BEBB1446.bstby1 Active Sessions: 777 88:2007.11.13 00:38:15:832 Env/TP-Processor2:INFO:CORE BEGIN Session=50D731F3EE59D3595A25140F166E9F93.bstby1 Active Sessions: 767 116:2007.11.13 00:38:16:793 Env/TP-Processor7:INFO:CORE BEGIN Session=B7977F67D06591A78AA2F290DBCE6F2C.bstby1 Active Sessions: 768 144:2007.11.13 00:38:19:219 Env/TP-Processor12:INFO:CORE BEGIN Session=19C3468F71BC6B2BEA03C3F2D4F74E44.bstby1 Active Sessions: 769 172:2007.11.13 00:38:21:930 Env/TP-Processor2:INFO:CORE BEGIN Session=13DA23B1E5787E4E07B3098A17CAFBAC.bstby1 Active Sessions: 770 Quote:
|
![]() |
| Bookmarks |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) |
|
| Thread Tools | |
| Display Modes | |
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Cups is not printing text file with proper format, staircasing issue | Ashish Pathak | CentOS / RHEL / Fedora | 1 | 11-18-2007 09:12 AM |
| can not find the username in /etc/passwd file | subrata1in | Getting started tutorials | 5 | 03-27-2007 12:45 PM |
| can not find user name in /etc/passwd file | subrata1in | Linux software | 2 | 03-26-2007 11:44 AM |
| rearranging columns in a text file | sureshbup | Shell scripting | 2 | 12-06-2006 10:43 AM |
| Replacing text in a file using awk | postyrus | Shell scripting | 4 | 05-02-2005 04:31 PM |