I have a program that is writing out code that will eventually be used in a different software package. The code gets written in separate pieces, and unfortunately the logic is such that I can't just generate the pieces in the order I eventually want them to be in. Once done, I want to combine the pieces in the correct order, e.g. if one tempory file is called front and another is called back I want to combine them into frontback.
Interactively this takes the better part of 30 seconds of copy and paste. But I would rather just have Stata generate everything in a single piece.
I am thinking I could open the final output file as read write and then do file read and write commands (basically copying the files one line at a time into a new file) but is there something simpler? If these were data files I could just use the append command but if such an easy solution exists it is currently eluding me.
Interactively this takes the better part of 30 seconds of copy and paste. But I would rather just have Stata generate everything in a single piece.
I am thinking I could open the final output file as read write and then do file read and write commands (basically copying the files one line at a time into a new file) but is there something simpler? If these were data files I could just use the append command but if such an easy solution exists it is currently eluding me.
Comment