Bash Shell script to replace the third value to zero if it has no value or empty.
values are closed by #^#^, seprated by pipe and records are terminated with new line
My file have so many lines ,so if any record/line of 3rd string/value contains empty or null needs
to be replaced by zero 0.
#^11abc27#^|#^x26729#^|#^#^|#^82.41#^|#^173#^|#^yx Corportaion#^
want change to
#^11abc27#^|#^x26729#^|#^0#^|#^82.41#^|#^173#^|#^yx Corportaion#^
Bash Shell script to replace the third value to zero if it has no value or empty.
values are closed by #^#^, seprated by pipe and records are terminated with new line
My file have so many lines ,so if any record/line of 3rd string/value contains empty or null needs
to be replaced by zero 0
#^11abc27#^|#^x26729#^|#^#^|#^82.41#^|#^173#^|#^yx Corportaion#^
want change to
#^11abc27#^|#^x26729#^|#^0#^|#^82.41#^|#^173#^|#^yx Corportaion#^
Senthil Kumar is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.