Creating r-file?

Hello,
I would like to ask, if there is some software which would simplify the creation process of the r-file. So far I tried to create simple blocks of material properties with headers in Matlab but I do not see how to create more sophisticated models. So I am searching for suggestions what is a suitable software for modelling geological subsurface (rho, vp, vs), parsing it with topography (adding dummy -999 values above the topography) and exporting it as a column of values which I could reshape and add a header in Matlab.
I am sorry if this question is not directly related to sw4 software issues, if requested I will close the topic.
Thank you very much for all your suggestions.