character replace

Hi,

I have rows in a file, in each row string starts with "A200819097564".

I want to replace the first character A with space.So the string looks like " 200819097564"

I tried "tr -s "A2008" " 2008""
But did not get the required outpit.

Thanks.

With sed:

sed 's/^./ /'

Regards

I tired the below command, it worked.But doubt is would it replae only the first letter in each row with space

sed "s/A2009/ 2009/g".

franklin,

sed 's/^./ /', your command would do the same thing?

thanks.

 sed "s/A2009/ 2009/g"

Your command replaces every "A2009" in a line, not only on the first position.
To match the pattern "A2009" at first position of a line, add a circumflex "^" at the begin of the pattern:

sed 's/^A2009/ 2009/'

This command:

sed 's/^./ /'

replaces every character at the begin of a line with a space.

Regards