I have a document structured with columns that look as follows:
1 151.065 Jp01.151065q 3.090 0
I want to remove the periods between the numbers. I have been trying to use sed to do so. However, either the periods remain after I try or the entire document disappears? I am confused about how to just remove those characters.
I believe your issue may be that you are not escaping the period leaving a regex that matches everything and consequently, deletes everything.
Using sed
$ sed '/\.//g' file
1 151065 Jp01151065q 3090 0
Using tr
$ tr -d '.' <file
1 151065 Jp01151065q 3090 0
Using awk
$ awk '{gsub(/\./,"")}1' file
1 151065 Jp01151065q 3090 0
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments