Filename and Pattern matching

Hiiiii every one,

I am facing a problem while giving a file name which has space in it.
The problem is ...
I have to read a file where the set of input files are stored.
Now getting that name I have to open the file and i have to extract the name of the user from  where it is written like"by xyz abc" - a single sentence. Now  by removing "by tag" i have to take only xyz abc and use it as an output file name like "xyz abc.xml"
now the problem is the space between the words. How to remove this and  make it as  a file name like xyzabc.xml

Any idea???? thanks in advance.:o

grep '^by' inputfile | read fld1 fld2 fld3 dummy
printf "%s%s.xml" fld2 fld3 | read mynewfilename

mynewfilename will be xyzabc.xml. The code assumes there is only one "by" record in a file.

newfilename=`awk '/^by/{print $2$3".xml" }' file`