dickiebird
Programmer
I've wrestled with this for long enough !
I have a text file with variable number of 0 (zero) on the beginning of most lines. I need to replace these leading zeros with same no. of spaces.
So far, I've got this :
sed 's/^0+/ /g' infile > outfile
which nearly does it ( It replaces 00000 or 000 etc with one space only.)
How would I replace all leading strings of zeros with a string of same number of spaces ?
TIA
;-)
Dickie Bird
db@dickiebird.freeserve.co.uk
I have a text file with variable number of 0 (zero) on the beginning of most lines. I need to replace these leading zeros with same no. of spaces.
So far, I've got this :
sed 's/^0+/ /g' infile > outfile
which nearly does it ( It replaces 00000 or 000 etc with one space only.)
How would I replace all leading strings of zeros with a string of same number of spaces ?
TIA
;-)
Dickie Bird
db@dickiebird.freeserve.co.uk