![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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 !! |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
Help on sed please
Hi,
I need get rid of all the dots and : in the below line 2005.11.11 09:37:28. I have tried the below command echo 2005.11.11 09:37:28 | sed -e 's/.//' -e 's/.//' -e 's/://' -e 's/://' No luck. Any help is very much appreciated. |
|
||||
|
Hi,
Can you please tell me, if there is anyway I can replace first n occurances of the character. For example: If the input is like below 2005.11.11 09:25:47 5.0 5.75 The output I need is: 20051111,092547,5.0,5.75 Many thanks, I'm a VMS guy myself, new to sed/awk. Just getting hang of things. So any help you guys could offer is very much appreciate. |
|
||||
|
Great. Many thanks for that. One finaly question on this,
how do I replace single quote echo "2005.11.11 09:25:47 5.0 5.75 'ABCD' " | sed -e 's/://g;s/ /,/g;s/\.//1;s/\.//1' Output should be 20051111,092547,5.0,5.75,ABCD I tried below, but not able to replace the single quote $echo "2005.11.11 09:25:47 5.0 5.75 'ABCD' " | sed -e 's/://g;s/ /,/g;s/\.//1;s/\.//1;s/\'//g' > ' sed: command garbled: s/://g;s/ /,/g;s/\.//1;s/\.//1;s/\//g $ echo "2005.11.11 09:25:47 5.0 5.75 'ABCD' " | sed -e 's/://g;s//,/g;s/\.//1;s/\.//1;s/''//g' 20051111,092547,50,575,'ABCD', $ echo "2005.11.11 09:25:47 5.0 5.75 'ABCD' " | sed -e 's/://g;s/ /,/g;s/\.//1;s/\.//1;s/'''//g' > ' 20051111,092547,50,575,'ABCD', Please help me out guys |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|