I need to remove leading and trailing whitespace characters from an input like this below using awk:
27 mA; 25 mA ; 24 mA ; 22 mA;
Required output:
27 mA;25 mA;24 mA;22 mA;
What I've tried:
awk -F";" '{$1=$1}1': doesn't remove the whitespaces, but removes;sawk -F";" '{gsub(/^[ \t]+|[ \t]+$/,""); print;}': doesn't remove the whitespaces
How can I modify these commands above to remove all leading and trailing whitespace (0x20) characters?
Update
Input might contain leading whitespace(s) at the first field:
27 mA; 25 mA ; 24 mA ; 22 mA;