delete 4 space in each line of code code example
Example: remove space at end of each line file
Use either one of both next commands with sed 's/to_replace/replace/':
sed 's/ *$//' file
sed 's/[[:blank:]]*$//' file
Use either one of both next commands with sed 's/to_replace/replace/':
sed 's/ *$//' file
sed 's/[[:blank:]]*$//' file