How to remove extra spaces in a variable?
VAR=" Eget ac vel volutpat dic tumst est dui adipiscing "
Correct result: VAR="Eget ac vel volutpat dic tumst est dui adipiscing"
There are over 16,000,000 to be edited; sed is too slow!
!!! E D I T !!!
String OK! Thank you all
BUT
Text in array problem, gaps remain :-(
ITM=(" Eget ac vel volutpat | Vel volutpat dic tumst "
" Vestibulum laoreet a semper |orttitor eu laoreet justo congue ")
IFS=$'|'
for (( i=0 ; i<16000000 ; i++ ))
do
AAA=( ITM[$i] )
B=${AAA[0]} # " Eget ac vel volutpat "
C=${AAA[1]} # " Vel volutpat dic tumst "
done
sedinstance and have it process all lines, each holding one of the strings.