Question about sed command
Hello,
Can I use sed to edit a txt file so that i removes all commas and combines the characters together ? ie: Before: 111,111,111 After: 111111111 Thanks for any help in advance. |
Yes, you certainly can.
A good tutorial will be http://www.grymoire.com/Unix/Sed.html |
Thanks syc. I was actually looking at that page. I'll try to find it. Was just wondering for some ideas/tips from the forum. Thanks.
|
Slightly cryptic hint: Just replace , with something and think globally:)
edit: Slightly less cryptic hint: Just replace , with nothing and think globally. |
Simple character replacement or deletion can also be done with tr.
And if the string is already stored in a shell variable, then there are a load of string manipulation techniques available to you. |
I must use sed becuase tr is not in my mks toolset. i'm trying to do this in a dos batch file. i'm just not familiar with sed at all (not since school, a long time ago, lol)
|
Quote:
Something like this ? s/,//g |
Quote:
|
No problem then. But it might help if you mention platform limitations like that when you post. It can have a big effect on whether you get useful answers.
As for your posted command, try it and see. ;) |
Quote:
|
Quote:
|
Glad to hear it. You might want to mark this thread as solved (in the thread tools)
|
All times are GMT -5. The time now is 08:06 AM. |