Feeding an xcmsRaw with a txt file could be a painful approach. If you only want to bin values have a look at the R function cut.
Here is a small example, which you could use as a starting point
#Generate some data
x <- rnorm(1000,0,10)
#sort data
x.sort <- sort(x)
#take a quick look
head(x.sort)
#[1] -31.44805 -29.43685 -28.45767 -28.18506 -26.27450 -25.92044
#generate bins with bin size of 0.1 over whole data range
bin <- seq(min(x)-0.1,max(x)+0.1,by=0.1)
#take a look at the bins
head(bin)
#[1] -31.54805 -31.44805 -31.34805 -31.24805 -31.14805 -31.04805
#So first bin starts at -31.54805 to -31.44805
binned.x=cut(x, breaks=bin, labels=FALSE)
head(binned.x)
#[1] 1 22 31 34 53 57
#As an results you retrieve bin indes, so first x values goes into bin of -31.54805 to -31.44805
Cheers,
Carsten