You can change the IFS beforehand, however you must remember to change it back. Keep in mind that spaces in datafields can cause other issues elsewhere also. (For instance, if you are going to use awk on the data, you would have the same issue.)
Something I often do is tr " " "_" or tr " " "~" before storing data, then reverse the tr command later in my processing. That way, I maintain the spacing integrity throughout.
thank you for your reply...can you tell me the command to change it (i tried with /n but it doesn't work)?
i suppose it should be something like set IFS=.....
thank you so much
echo "$IFS" will show you what is in there.
However, you might be better with
echo "$IFS" | od -b
since you will now see
0000000 040 011 012 012
meaning, 040=space and 011=tab and 012=LF and echo gives the last 012
To change,
IFS=:
would change to colon
In programming, you might want to save the current IFS
curr_ifs=$IFS
do whatever, and then put it back
IFS=$curr_ifs