awk:delete_both_leading_and_trailing_whitespaces_from_each_line
AWK - Delete both leading and trailing whitespaces from each line
awk '{ gsub(/^[ \t]+|[ \t]+$/, ""); print }' file.txt
Example
awk/delete_both_leading_and_trailing_whitespaces_from_each_line.txt · Last modified: 2021/01/06 16:15 by peter