My file is as follows:
1 chrX_73833098_73834098 1 chrX_73889652_73890652 1 chrX_91194501_91195501 1 chrX_92000157_92001157 1 chrX_92106500_92107500
I want to replace the first character "1" with 0. Required output:
0 chrX_73833098_73834098 0 chrX_73889652_73890652 0 chrX_91194501_91195501 0 chrX_92000157_92001157 0 chrX_92106500_92107500
Trying to do this with this:
sed 's/^./0/g' file
But the way out:
0 1 chrX_73833098_73834098 0 1 chrX_73889652_73890652 0 1 chrX_91194501_91195501 0 1 chrX_92000157_92001157 0 1 chrX_92106500_92107500
I believe that there is an easy way to fix this, but I do not know this.
source share