I have large number of files that have an deprecated css value hspace and I want to change it with other css style value. Here is an example:we have:hspace='5'and we want to change with:style=margin: 0 5px;each file has different value inside hspace, one can be  hspace='5' other hspace='2', hspace='7' and so on.what I want is find in all files in specific directory:hspace='ANY NUMBER'and replace with:style=margin: 0 5px;Any suggestion to do this in bash centos os?
Replacing text between two specific strings
centos;text processing;replace
You can use this command for replacing (assuming GNU sed as found on CentOS):sed -i s/hspace='\([0-9]*\)'/style=\margin: 0 \1px;\/g filename.htmlTo replace in all .html-files:find . -type f -name '*.html' -exec sed -i s/hspace='\([0-9]*\)'/style=\margin: 0 \1px;\/g {} +