read command

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?

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.

What about this line:

Will it work?

Try it. Your definition of "work" might be more complex than we can guess.

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.