I shared my MATLAB code with proper explanation in the sense, that it will help others and make the problem much easier. In further emails I stated my problems which I am encountering in Octave while executing the same procedure that i did in MATLAB.
However, If helping someone to extract certain format of text file data means "WRITING SOMEONE ELSE SOFTWARE" then, this thread is no longer useful.
Thanks everyone for your valuable time.
Now, you are bringing in two text files of nicely tabulated, delimited data, mostly numerical but with text headers, and want to export a delimited data file with the data rearranged. I pointed out that if you can replace 'splitapply', which is really a wrapper matlab uses to combine multiple lower level functions, it seems the rest of the process should work. That said, you have a fairly involved process for handling and massaging all of this data. my usual approach is to do a dlmread of the files, assign columns to variables, and then work with them that way to manipulate and rearrage the data, construct a new variable with the data in the order I want, and then do a dlmwrite to output the revised text file. If I have time to step through all of your code, I might look at whether or not this is manageable. maybe if you want special header handling, you'll need something a bit more involved to handle multiple types of data (text labels, numeric data, etc.), but I've rarely needed to do much more that basic file I/o and array concatenation to make things like this work.