Code:
while (loop to get all row) {
  var %rowdata = $+(%rowdata $eval($var(%rowdata.*, %f),2)),$str($chr(32),%diff))
}
var %rowdata = $+(%rowdata, $crlf)
bwrite filename.txt -1 -1 $(%rowdata,)


A variable can contain multiple spaces following one another, some times u might loose them depending on how you join other things to the end, thus my use of $+(part1,part2) over part1 $+ part2 (although i dont think it was strictly needed.
I didnt add anything else to the loop, just showed it to infer your repeating untill you have the line built ready for writing to the file.
I added a $crlf to the end of the line for the file as well since bwrite JUST writes what ya tell it.

Heres the bit thats odd, the BWRITE if u used %rowdata on its own, it gets expanded by mirc into its contents, and all the extra spaces get swallowed. so you need to tell mirc to evaluate this zero times $eval(%rowdata,0) or the shortened version $(%rowdata,). Now mirc just leaves that as %rowdata, and the /bwrite command goes, Oh ok ill write the contents of %rowdata out to the file, along with all them spaces!