Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Replacing a specific column range of blanks with 0s in a data file

rjsosiJul 12 2021

Hi,
We're using Redhat Linux 7.9 with bsh.
I want to go through a data file and replace all the fields between columns 10 and 20 that have blanks with 0s.

So if I have an example file of:
"#######################
#######################
#######################
######### ######
#######################
#######################
#######################
#######################"
I want the script to make it look like :
"#######################
#######################
#######################
#########000000000######
#######################
#######################"
#######################
#######################"

Thanks!

Comments
Post Details
Added on Jul 12 2021
6 comments
307 views