I think that import of many files to your Mathematica Kernel (if it is not necessary) is not good idea.
Better way is import one file and do something (preprocessing) and store result. After then clear data and import next file. For my advice I recommand you use $HistoryLength=0;
If you would like only correct your code then solution is there:
Thanks for your reply. I wish that was feasible, in fact the best way would be to first use MS Excel and do most of the pre-processing (remove/add/calculate columns and rows etc) of the data and import as an .xls sheet, but I have 101 files, my next simulation run will have even more, and also I would want more automation to the entire system, ie from running the simulation to plotting the results in a BubbeChart. That’s why I am looking for a loop statement.
Thank your for your reply, but the problem is simulation’s output directory also contains 200 other massfunction.out, mergerhistories.out files which I don’t want.