linux:sed:remove_all_leading_and_trailing_whitespace_from_a_file
This is an old revision of the document!
Table of Contents
Linux - SED - Remove whitespace from a file
Delete trailing whitespace from end of each line
cat input.txt | sed 's/[ \t]*$//' > output.txt
Remove all leading and trailing whitespace from end of each line
cat input.txt | sed 's/^[ \t]*//;s/[ \t]*$//' > output.txt
linux/sed/remove_all_leading_and_trailing_whitespace_from_a_file.1575974861.txt.gz ยท Last modified: 2020/07/15 09:30 (external edit)