I have a text file that looks like this:
HETATM11584
HETATM 2514
HETATM22222
HETATM 8585
HETATM 1213
HETATM62626
HETATM 6754
There are white spaces separating HETATM from a string of numbers. I want to delete theses white spaces and output a new file that looks like this:
HETATM11584
HETATM2514
HETATM22222
HETATM8585
HETATM1213
HETATM62626
HETATM6754
I tried to use sed
sed 's/.*HETATM [1-9]*.*/.*HETATM[1-9]*.*/' HETATM.txt > teste.txt
But the output looks like this:
HETATM11584
.*HETATM[1-9]*.*
HETATM22222
.*HETATM[1-9]*.*
.*HETATM[1-9]*.*
HETATM62626
.*HETATM[1-9]*.*
What is the proper sed synthax for this operation?