Re: Prepending Data to a File
- To: mathgroup at smc.vnet.net
- Subject: [mg116838] Re: Prepending Data to a File
- From: David Annetts <david.annetts at iinet.net.au>
- Date: Wed, 2 Mar 2011 04:33:13 -0500 (EST)
Hi Gregory, This is something I'd be doing from a command line copy newstuff+oldstuff oldstuff D. On 1/03/2011 18:20, Gregory Lypny wrote: > Hello everyone, > > I have a big multi-line, comma-delimited data file. How would I prepend > new data to it, that is, insert new lines, generated in Mathematica, at > the beginning of the file without importing the file into Mathematica? > > Suppose my file myData.csv contains > > 31,32,33 > 41,42,43 > 51,52,53 > > and I've now generated these two new lines (lists) in Mathematica > > 11,12,13 > 21,22,23 > > I'd like to prepend those two lines to myData and end up with > > 11,12,13 > 21,22,23 > 31,32,33 > 41,42,43 > 51,52,53 > > I'm guessing that the Write function would do the trick, but I'm not > sure about the syntax. > > Regards, > > Gregory > >