mardi 24 mars 2015

How to remove a particular character after a specific word


How do I remove the , character after a specific word?


For example, I want to delete the , character after the word IBM



IBM, Inc.:APP-VM-Core:4.4.2.0:04,


the expected results should be



IBM Inc.:APP-VM-Core:4.4.2.0:04,


Meanwhile I do the following



echo “IBM, Inc.:APP-VM-Core:4.4.2.0:04,” | sed s'/,//'


but the problem is that it deletes every , character, no matter what the first word was before the ,. In my case I want to delete the , only after IBM.


Example:



echo "APPLE, Inc.:APP-VM-Core:4.4.2.0:04,"| sed s'/,//'

APPLE Inc.:APP-VM-Core:4.4.2.0:04,


but should be as



APPLE, Inc.:APP-VM-Core:4.4.2.0:04,


Aucun commentaire:

Enregistrer un commentaire