Re: Prepending Data to a File
- To: mathgroup at smc.vnet.net
- Subject: [mg117000] Re: Prepending Data to a File
- From: David Bailey <dave at removedbailey.co.uk>
- Date: Mon, 7 Mar 2011 05:47:46 -0500 (EST)
- References: <ikvohr$f58$1@smc.vnet.net>
On 06/03/2011 10:44, Gregory Lypny wrote: > Hello David, > > Thanks for responding. Appending would work fine as well. How do I do that in Mathematica? > You open the file in Append mode: strm=OpenAppend[file] Then write to the stream, typically with Write or WriteString, then use Close[strm] to make sure the file is closed properly. Appending to files is MUCH easier to do than Prepending in any language! David Bailey http://www.dbaileyconsultancy.co.uk