|Hmm, never done that before because you could over run your memory. Why do you need it in a memory variable instead of a file?|
If you have to do it then try this in a script...
For /F "tokens=* delims= " %%A in (small.txt) do (
call :setvar %%A)
set MyVar=%MyVar% %1
Now variables can not support (Tabs and Carriage Returns) so they will be stripped out. So again I have to ask what are you doing that you need to do this?