hi,
the input file text contains multiple spaces, tabs, multible tabs and I need to replace all of them with single space
which command removes all leading and trailins spaces:
sed "s/^[[:space:]]*//;s/[[:space:]]*$//"
I tried to use this for removign white spaces inside the it doesn't do it.. (the red commands)
what the last sed on pipe should be?
the input file text contains multiple spaces, tabs, multible tabs and I need to replace all of them with single space
which command removes all leading and trailins spaces:
sed "s/^[[:space:]]*//;s/[[:space:]]*$//"
I tried to use this for removign white spaces inside the it doesn't do it.. (the red commands)
Code:
# echo " \t sdfsd s sdfs sdfs ete\t"
sdfsd s sdfs sdfs ete
# echo " \t sdfsd s sdfs sdfs ete\t"|sed "s/^[[:space:]]*//;s/[[:space:]]*$//"
sdfsd s sdfs sdfs ete
# echo " \t sdfsd s sdfs sdfs ete\t"|sed "s/^[[:space:]]*//;s/[[:space:]]*$//"|sed s/$/\|/
sdfsd s sdfs sdfs ete|
# echo " \t sdfsd s sdfs sdfs ete\t"|sed "s/^[[:space:]]*//;s/[[:space:]]*$//"|[red]sed "s/[[:space:]]*/\ /"[/red]
sdfsd s sdfs sdfs ete
# echo " \t sdfsd s sdfs sdfs ete\t"|sed "s/^[[:space:]]*//;s/[[:space:]]*$//"|[red]sed "s/[[:space:]]*/\ /g"[/red]
s d f s d s s d f s s d f s e t e
#
what the last sed on pipe should be?