COD
April 25, 2008, 7:42am
1
I have file which is space filled likE below
Note: here spaces are replaced by |.
When I use read command to read this file all the spaces are truncated only the default space is not removed. The output is
Note: here spaces are replaced by |.
Can this default truncation be override?
grial
April 25, 2008, 7:58am
2
I assume you are storing each line of the file in a variable. In that case, use double quotes:
MYVARIABLE="ABC8457573759 5565656 564645645646"
echo "$MYVARIABLE"
Regards.
era
April 25, 2008, 10:53am
4
Try it. Your definition of "work" might be more complex than we can guess.
COD
April 26, 2008, 4:49pm
5
Nope, its doesn't. The trailing and preceeding spaces are truncated. But if
is set to something like
then the preceeding and trailing spaces can also be taken into account.